I need to split my String by spaces. For this I tried:
str = \"Hello I\'m your String\";
String[] splited = str.split(\" \");
But it doesn\
Use Stringutils.split() to split the string by whites paces. For example StringUtils.split("Hello World") returns "Hello" and "World";
In order to solve the mentioned case we use split method like this
String split[]= StringUtils.split("Hello I'm your String");
when we print the split array the output will be :
Hello
I'm
your
String
For complete example demo check here