Android convert string to integer and integer to string
This is a basic tutorials, but this is very important when you want to convert your character data type.
For string to integer you can use this following codes
String et = "1233545";
int xx = Integer.parseInt(et);
String s="your1string2contain3with4number";
int i=Integer.parseInt(s.replaceAll("[\D]", ""));
int i=Integer.parseInt("hello123".replaceAll("[\D]",""));
String str = "123" ;
int i = Integer.parse(str);
Now lets move to integer to string.
int i = 5;
String strI = String.valueOf(i);
Done.
Comments
Post a Comment
Leave a comment hdh