Skip to content

Instantly share code, notes, and snippets.

@edinak1
Created October 17, 2015 16:33
Show Gist options
  • Save edinak1/deb410e08bb6513ef3bc to your computer and use it in GitHub Desktop.
Save edinak1/deb410e08bb6513ef3bc to your computer and use it in GitHub Desktop.
package numbers;
public class Seventh {
public static void main(String[] args) {
String name="Let us always meet each other with smile, for the smile beginning of love.";
System.out.println(name.replace("smile",":)"));
//TEST for .replace() interesting for me:))
System.out.println(name.replace(":)","smile"));
System.out.println(name.replace("smile"+" ",":)"));
System.out.println(name.replace(" ",""));
System.out.println(name.replace("","@"));
System.out.println(name.replace(" ","*"));
String str="";
System.out.println(str.replace("","Hello!"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment