分类: Java
2012-02-01 15:48:47
public class Replace
{
public static String replace(String input)
{
return input.replace("l", "x") ; //将hello 变为hellx
//若input.replace("ll","a") ;则显示heao ; 若helllo则healo
//若input.replace("l","x") ;则显示hexkxo
}
public static void main(String[] args)
{
System.out.println(replace("hello"));
}
}