there are helper function available to do this. check this isDigit(char ch)
Thanks, AJ On Oct 10, 3:02 pm, ragavendran s <[email protected]> wrote: > hi Aj here i i know how to display list the only problem is how to retrieve > > the corresponding values.....can i separate the intager values and string > values from > string str ="1.one.2.two.3.three".....i need separate these "1" as integer > value and "one " as string value...... > > On Sat, Oct 10, 2009 at 2:57 PM, ragavendran s <[email protected]>wrote: > > > Hi AJ thanks for ur kind reply.... > > > Here i need one more.... > > > output: > > > one > > 1 > > two > > 2 > > three > > 3 > > > i want separate this like :one,two,three in list > > > the list like this > > one > > two > > three > > > when i click the one it will display 1(it the corresponding value shown in > > output) when i click two it should display 2.... > > > i want to separate string values and integer values...when i access string > > value it should tell corresponding integer values... > > > Thanks in Advance, > > > Raghav.S > > > On Sat, Oct 10, 2009 at 2:41 PM, AJ <[email protected]> wrote: > > >> 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 -~----------~----~----~----~------~----~------~--~---

