public class TestReplace {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String text = "I LIKE JAVA";
String newText = text.replace('I', 'L'); // Modify the string text
System.out.println(newText);
}
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String text = "I LIKE JAVA";
String newText = text.replace('I', 'L'); // Modify the string text
System.out.println(newText);
}
}
结果如下:L LLKE JAVA