Re: [android-developers] HOw to extract only number

2012-03-08 Thread harshita agrawal
if you enter only 5002 the it gets null value in space1 so it's crashed.To solve these problem you can do like this: str=txt.getText().toString(); int space1=str.indexOf(" "); if(space!=null){ s=str.substring(0, space1); } else { s=str; } On Tue, Mar 6, 2012 at 11:06 AM,

Re: [android-developers] HOw to extract only number

2012-03-05 Thread Narendra Singh Rathore
> > can anybody know how to do successfully pass the number. Hey Jagruti, I guess I know. Try this, I m sure this will help you out. String s=txt.getText().toString(); String lines[]=s.split("\\r?\\ "); String str=lines[0]; Regards, -- You received this message because you are subscribed

[android-developers] HOw to extract only number

2012-03-05 Thread Jagruti Sangani
Hello, I have textbox in that some time i will enter the onlu number like 96350254 or 5002 those are not in fix length.and sometimes if select from contact then in text box number will be with the name like "5002 jagruti".when i press the button then i want to pass only the number to the other