package 算法;
public class 取出字符串中数字的最大值 {
public static void main(String[] args) {
String a1="er23425tyeu5";
String b1=a1.replace("\\D", "");//剔除非数字
System.out.println(b1);
int max=-1;
if(b1!=null && b1!=""){
for(int i=0;i<b1.length();i++){
max=Integer.parseInt(b1.substring(i, i+1))>max?Integer.parseInt(b1.substring(i,i+1)):max;
}
}
System.out.println("max="+max);
}
}