import java.util.Arrays;
public class StringTest {
private static String[] colIds = {"abc","def","ghi"};
public static void main(String[] args) {
String s = Arrays.toString(colIds);
// remove leading and trailing brackets, i.e. "[" and "]"
System.out.println(s.substring(1, s.length()-1));
}
}
the output will look like this:
abc, def, ghi
if you take away the substring code, then the output will look like this:
[abc, def, ghi]
IT, computer and programming tutorials and tips that i couldnt find anywhere else using google, from my daily work as a Senior Developer of solutions using Java and Linux.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment