日期:2014-05-20 浏览次数:20883 次
System.out.println("***************************");
String d1="abcd";
String d2;
char m='\16';
d2=d1.replace('a',m);
System.out.println("d2="+d2);
d2=d1.replace('b',m);
System.out.println("d2="+d2);
d2=d1.replace('c',m);
System.out.println("d2="+d2);
System.out.println("***************************");
System.out.println("\100");
byte []b = {0100}; //八进制表示法
System.out.println(new String(b));
public class StringTest
{
public static void main(String[] args)
{
String str = "Helloc";
String s1 = str.replace('o', 'b');
String s2 = str.replace('c', '\16');
System.out.println(s1);
System.out.println(s2);
String s2 = str.replace('h', 'd');
System.out.println(s2);
}
}