Hi Raghav
See the following code:
--------------------------------------------------------------------------------
StringBuffer sb = new StringBuffer();
String str="one.1.two.2.three.3";
Pattern p =Pattern.compile("[.\\d.]");
String[] items = p.split(str);
for(String s : items) {
sb.append(s);
sb.append("\n");
}
System.out.println(sb.toString());
--------------------------------------------------------------------------------
hope this helps you.
Thanks,
AJ
On Oct 10, 1:47 pm, ragavendran s <[email protected]> wrote:
> Sorry
> Here is my Revised Code....
>
> problem in StringTokenizer
>
> String str="one.1.two.2.three.3"
> StringBuffer sb;
> Stringtokenizer tok=new Stringtokenizer(str);
> while(tok.hasmoreTokens())
> {
> sb.append(tok.nextToken);
>
> }
>
> Sustem.out.println(sb.toString());
>
> output:
>
> one
> 1
> two
> 2
> three
> 3
>
> but i need output like this:
> one
> two
> three
>
> i want to cut the values 1,2,3
>
> Thanks in Advance
> Raghav.S
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---