-4

In C# this would work - String[] elements = sample.Split((char)30);

What is the java equivalent?

user2352834
  • 69
  • 1
  • 2
  • 8

1 Answers1

5

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));
shmosel
  • 49,289
  • 6
  • 73
  • 138