public static String[] split(String s, char separator) {
Vector v = new Vector();
for (int ini = 0, end = 0; ini < s.length(); ini = end + 1) {
end = s.indexOf(separator, ini);
if (end == -1) {
end = s.length();
}
String st = s.substring(ini, end).trim();
if (st.length() > 0) {
v.addElement(st);
} else {
v.addElement("null");
}
}
String temp[] = new String[v.size()];
v.copyInto(temp);
return temp;
}
Subscribe to:
Post Comments (Atom)
found very helpful.
ReplyDeleteI need it. Thnx.
Welcome
ReplyDelete