You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
299 B
Java
8 lines
299 B
Java
5 years ago
|
public class StringReplaceEmp {
|
||
|
public static void main(String args[]) {
|
||
|
String str="Hello World";
|
||
|
System.out.println( str.replace( 'H','W' ) );
|
||
|
System.out.println( str.replaceFirst("He", "Wa") );
|
||
|
System.out.println( str.replaceAll("He", "Ha") );
|
||
|
}
|
||
|
}
|