public class TestUpper{
public static void main(String[] ages){
String str="I/*L3O2VlsfssfEdJsdfsfAsf1sdfsVf6sAfssdffs/f*sf-sdf#sf$s%f3g5sdg4segswd";
System.out.println(str.replaceAll("[^A-Z]","")); //把所有不是大寫字母的字符全部替換為空
}
}
//運行結果
//ILOVEJAVA
posted on 2009-03-13 08:10
Werther 阅读(280)
评论(0) 编辑 收藏