ExecuteProgram
Home
Java
Selenium Webdriver
Extracting only characters from the string contains both integer and characters
Tweet
Pin It
E
xtracting only
N
on
D
igit
B
y
E
xcluding
I
ntegers
Example:
public class string_to_int {
public static void main(String[] args) {
String s ="this is 100 rupees";
String s2=s.replaceAll("\\d", "");
System.out.println(s2);
}
}
Output:
this is rupees
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment