public class StringManip {
public static Vector split(String str, final String delim, boolean discardEndData) {
Vector vComponents = new Vector();
int index = 0;
while (index < str.length()) {
int newIndex = str.indexOf(delim, index);
if (newIndex > 0) {
vComponents.addElement(str.substring(index, newIndex));
} else {
if (discardEndData == false) {
vComponents.addElement(str.substring(index));
}
break;
}
index = newIndex + delim.length();
}
return vComponents;
}
example :-
Vector v = StringManip.split("aaa,aaaa,aaa,aa" , ",", false);
puppuleeeeeeeeeeeeeeeeeeeeeeee
ReplyDeleteHi there, awesome site. I thought the topics you posted on were very interesting. I tried to add your RSS to my feed reader and it a few. take a look at it, hopefully I can add you and follow.
ReplyDeleteJ2ME Application Development