静态方法:
String.valueOf(Object object) ---把其他类型转换成String类型。
字符串型转换成各种数字类型:
byte b = Byte.parseByte( s );
short t = Short.parseShort( s );
int i = Integer.parseInt( s );
long l = Long.parseLong( s );
Float f = Float.parseFloat( s );
Double d = Double.parseDouble( s );
方法:
1.string.trim()---去掉两端空格
2.string.length() ---字符串的长度
3.string.charAt(int index) ---第index位的字符。
4.stirng.substring(int beginIndex,int endIndex) ---剪切字符串,从beginIndex到endIndex
5.stirng.indexOf(String s) ---返回第一个符合字符串的位数。如果没有返回“-1”
原文:http://www.cnblogs.com/lovgge/p/3612212.html