- 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
Related Posts:
To print sum of digits: To print sum of digits: public class SumOfDigits { public static void main(String[] args) { int num = 67; System.out.println(getSumOf… Read More
write a calculator program using Html ans JavaScript calculator program using HTML and JavaScript: <HTML> <HEAD> <STYLE> #ab{height:50%; width:50%; } </STYLE> </HEAD> <… Read More
Matrix Addition program using java Matrix Addition program using java package day1; import java.util.Scanner; public class MatrixAddition { public static void main(String[] args)… Read More
To check the given number is Amstrong or Not package date24; public class Amstrong { public static void main(String[] args) { int first = 153; int num = first; int digits = 0; while … Read More
java program to print square of stars package day2; import java.util.Scanner; public class PrintSquareBox { public static void main(String[] args) { int num = 5; for (in… Read More
0 comments:
Post a Comment