To split a string, use String.split():
http://developer.android.com/reference/java/lang/String.html#split(java.lang.String)
For the ListView, use an ArrayAdapter that maps an array of items to
be displayed in a a list. Each item can be of a class you define that
contains the name and id. Tell
I think there API's to check if it is a digit also you could just
convert the each value to integer which ever fails you can print that
ones
On Oct 10, 11:55 am, ragavendran s sraghav.ra...@gmail.com wrote:
problem in StringTokenizer
String str=one.1.two.2.three.3
Stringtokenizer tok=new
what is st and sb ??
Thanks,
AJ
On Oct 10, 11:55 am, ragavendran s sraghav.ra...@gmail.com wrote:
problem in StringTokenizer
String str=one.1.two.2.three.3
Stringtokenizer tok=new Stringtokenizer(str);
while(st.hasmoreTokens())
{
sb.append(st.nextToken);
}
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
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
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);
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
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
there are helper function available to do this. check this
isDigit(char ch)
Thanks,
AJ
On Oct 10, 3:02 pm, ragavendran s sraghav.ra...@gmail.com 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
9 matches
Mail list logo