What should I do if I want to split the characters of any string considering gaps and no gaps?
For example, if I have the string My Names James I want each character individually like this: M y n a m e s etc.
You mean this?
String sentence = "Hello World";
String[] words = sentence.split(" ");
Also if you would like to get the chars of the string you could do this:
char[] characters = sentence.toCharArray();
Now you just need a loop to iterate the characters and do whatever you want with them.
Here a link to the java API documentation there you can find information about the String class.
http://download.oracle.com/javase/6/docs/api/
I hope this was useful to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With