Thanks, Problem solve
with
public String[] split(String regex,int limit)
cheers,
"Liang Yew" <> wrote in message
news:bffngg$eut$...
Refer to the javasoft document,
The string "b,,andf,," for example, yields the following results with these
expressions:
Regex Result
, { "b", "", "andf" }
my expected result it {"b","","andf","","")
is that mean i must have space instead of "" of the raw data?
Cheers
"Lee Weiner" <> wrote in message
news:q3ISa.96107$ et...
In article <bfffjp$7hg$>, "Liang Yew" <>
wrote:
>Hei,
>I have problem with this
>if i have test with
>aa,bb,cc,dd
>aa,,cc,dd
>
>and use
>StringTokenizer str=new StringTokenizer(str,",",false)
>after i read the data will be as
>aa
>bb
>cc
>dd
>aa
>cc
>dd
>the blank data in row 2 is missing. any suggestion or any suggestion on
>method using beside stringtokenizer?
If you're using JDK 1.4, use the String class split() method. It deals
properly with the empty tokens.
Lee Weiner
lee AT leeweiner DOT org
|