I only want the first element from s.split(",") and I need to return value to be in a String array.
How can I make this code a one liner?
String [] sd = s.split(",");
String [] sf = new String[]{sd[0]};
I tried s.split(",",1); but it just adds it all to the first element without actually splitting it.
sfrom 0 to the index of the first occurrence of,right? Why notString sd[] = {s.split(",")}