1
2
3
4
|
String s = "my.test.txt" ; System.out.println(s.replace( "." , "#" )); System.out.println(s.replaceAll( "." , "#" )); System.out.println(s.replaceFirst( "." , "#" )); |
1
2
3
|
my#test#txt ########### #y.test.txt |