samedi 5 avril 2014

Why do I get blank spaces after splitting the string by dot?


Vote count:

0




I am trying to split a String by . :



String sentences[] = fileContent.split(".");


fileContent is a string that contains the complete text data from a file. In the file there are 4 sentences some separated by white space gaps.


When I print sentences[n] it gives a blank . Why is it so when sentences.length prints 95.


Data structured in fileContent looks like : (no-meaning text)



My name is suhail. His name is suhail.

He was playing with suhail. He is cool and loves suhail.


asked 46 secs ago






Aucun commentaire:

Enregistrer un commentaire