if we have this string : number of doses(1000mg/m2)
and i want to separate each word in a string
when i do this
the output is :
number
of
doses(1000mg/m2)
but i want to separate each word so that the output is:
number
of
doses
(
1000
mg/m2
)
how can i do this??
and i want to separate each word in a string
when i do this
Code:
String doses = "number of doses(1000mg/m2)";
String[] split = doses.split(" ");
for(int i=0 ; i<split.length ; i++){
System.out.println(split[i]);
}
number
of
doses(1000mg/m2)
but i want to separate each word so that the output is:
number
of
doses
(
1000
mg/m2
)
how can i do this??
Comment