For example, If I have an array
String[] myStringArray = new String[]{"x", "a", "r", "y"};
How do I make a singular string that is "xary"
Answer
String[] myStringArray = new String[]{"x", "a", "r", "y"};
StringBuilder builder = new StringBuilder();
for(String s:myStringArray)
builder.append(s);
System.out.println(builder );
No comments:
Post a Comment