|
|
@@ -1,20 +1,19 @@
|
|
|
package com.uas.platform.b2b.core.util;
|
|
|
|
|
|
-import org.springframework.security.authentication.encoding.Md5PasswordEncoder;
|
|
|
/**
|
|
|
* 将字符串中的非数字字符去掉
|
|
|
- * @author af
|
|
|
+ * @author aof
|
|
|
+ * @since 2015年7月31日11:35:56
|
|
|
*
|
|
|
*/
|
|
|
public class StringUtils {
|
|
|
public static String testString(String str){
|
|
|
- char[] c=new char[str.length()];
|
|
|
- String str2="";
|
|
|
- for(int i=0;i<str.length();i++){
|
|
|
- String tem=""+str.charAt(i);
|
|
|
- if(tem.matches("[0-9.]")){
|
|
|
- str2+=tem;
|
|
|
- }
|
|
|
+ String str2 = "";
|
|
|
+ for(int i = 0; i < str.length(); i ++) {
|
|
|
+ String tem = "" + str.charAt(i);
|
|
|
+ if(tem.matches("[0-9.]")) {
|
|
|
+ str2 += tem;
|
|
|
+ }
|
|
|
}
|
|
|
return str2;
|
|
|
}
|