In C# this would work -
String[] elements = sample.Split((char)30);
What is the java equivalent?
In C# this would work -
String[] elements = sample.Split((char)30);
What is the java equivalent?
String.split()
takes a regex string. For your purpose, you just need to convert the char
to a String
:
String[] elements = sample.split(Character.toString((char)30));