赞
踩
StringBuffer result = new StringBuffer();
int n = s.length();
for (int i = 0; i < n; i++) {
char temp = s.charAt(i);
if (Character.isLetterOrDigit(temp)) {
result.append(Character.toLowerCase(temp));
}
}
StringBuffer war = new StringBuffer();
war = result.reverse();
StringBuffer result1 = new StringBuffer(result).reverse();
System.out.println("result " + result);
System.out.println("result1 " + result1);
System.out.println("war " + war);
结果
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。