Reputation: 839
I'm have the following string str = "one|two|three|four|five"
I try to split it using str1[]=str.split("\\|");
, but it shows exception while debugging.
The error is Exception processing async thread queue
. What's this and how to do it?
Upvotes: 0
Views: 378
Reputation: 594
Please try this one...
in = "Your String";
StringTokenizer st = new StringTokenizer(in, "|");
while(st.hasMoreTokens()) {
String str = st.nextToken();
System.out.println(str);
}
Upvotes: 1
Reputation: 54322
try this,
String tempString="one|two|three|four|five";
String str1[]=tempString.split("\\|");
for(int i=0;i<str1.length;i++)
{
Log.i("Str1["+i+"]",str1[i]);
}
Result is,
Str1[0]: one
Str1[1]: two
Str1[2]: three
Str1[3]: four
Str1[4]: five
Upvotes: 1