String Array to String separator java
How to convert String Array to String with separator java code, Examples
public static String arrayToString(String[] a, String separator) {
String result = "";
if (a.length > 0) {
result = a[0]; // start with the first element
for (int i=1; i
result = result + separator + a[i];
}
}
return result;
}
public static String arrayToString(String[] a, String separator) {
String result = "";
if (a.length > 0) {
result = a[0]; // start with the first element
for (int i=1; i
result = result + separator + a[i];
}
}
return result;
}
Comments
Post a Comment