StringBuilder转化为String

	StringBuilder stb = new StringBuilder();
String str=stb.toString(); //方法1
String str=""+stb; //方法2

String转化为StringBuilder

	String str = "abcdefghijklmnopqrs";
StringBuilder stb = new StringBuilder(str);

整型数组转化为字符串

	StringBuilder s = new StringBuilder();
for(i=1;i<=n;i++) {
s.append(String.valueOf(a[i]));
}
String str = ""+s;

字符串转化为整形数组

	String str="123456";
int[] a = new int[str.length()];
for(int i=0;i<str.length();i++) {
a[i] = str.charAt(i)-'0';
}

字符串转化为字符数组

	String str="123456";
char[] c = str.toCharArray() ;
System.out.println(c);

字符数组转化为字符串

	char[] c = {'a','s','d','4','5',};
String str = new String(c);
System.out.println(str);

字符数组转化为整型数组

	char[] c = { '1', '2', '3', '4', '5', };
int[] a = new int[c.length];
for (int i = 0; i < 5; i++) {
a[i] = c[i] - '0';
System.out.println(a[i]);
}

整型数组转化为字符数组

	int[] a = {1,2,3,4,5};
char[] c = new char[a.length];
for (int i = 0; i < 5; i++) {
c[i] = (char) (a[i]+'0');
System.out.println(c[i]);
}



整型数转化为字符串

1.String str = Integer.toString(i);
2.String s = String.valueOf(i);
3.String s = "" + i;

字符串转化为整型数

int i = Integer.valueOf(str).intValue();
05-11 20:23