- public class StringReplace {
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- String str = "ha656rishwajhd8676676r";
- System.out.println("enput string is= "+str);
- String strstr;
- strstr=str.replaceAll("[a-z]", "");
- System.out.println(strstr);
- }
- }
Output:6568676676
Write a program to Get numbers from String
- Output:6568676676
0 comments:
Post a Comment