How can I split the following word in to an array
That\'s the code
into
array 0 That 1 s 2 the 3 code
I tried
You can split according to non-characters chars:
String str = "That's the code"; String[] splitted = str.split("[\\W]");
For your input, output will be:
That s the code