While programming it may requires to split the string into words, to accomplish this one can use ‘StringUtilities’ class like :
StringUtilities su = null;
String[] abc = su.stringToWords("Xyz XYZ xyz xyZ");
Output : abc[0] = “Xyz”, abc[1] = “XYZ”, abc[2] = “xyz”, abc[3] = “xyZ”.
Or you can use following helper method to do the same :
public static final String[] splitString(final String data, if (indexStart != data.length()) { } else { String[] result = new String[v.size()]; |
It has the ability to skip any blank lines ( typically split on \n), so it also has the ability to remove any blank sequences it encounters.
No comments:
Post a Comment
Place your comments here...