Extracting only characters from the string contains both integer and characters

Extracting only Non Digit By Excluding Integers


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