i've a string that looks like
^blood pressure^ glucose visual
using StringTokenizer with ^ as deliminators, i'm able to split the string into
blood pressure
glucose visual
but if i want to split it into
blood pressure
glucose
visual
how should i modify my code?
any kind soul pls advise
String input = "^blood pressure^ glucose visual";
StringTokenizer strtok = new StringTokenizer(input,"^"
while(strtok.hasMoreTokens())
{
String aword = strtok.nextToken().trim();
System.out.println(aword);
}
^blood pressure^ glucose visual
using StringTokenizer with ^ as deliminators, i'm able to split the string into
blood pressure
glucose visual
but if i want to split it into
blood pressure
glucose
visual
how should i modify my code?
any kind soul pls advise
String input = "^blood pressure^ glucose visual";
StringTokenizer strtok = new StringTokenizer(input,"^"
while(strtok.hasMoreTokens())
{
String aword = strtok.nextToken().trim();
System.out.println(aword);
}