Java tutorial
public class MainClass { public static void main(String args[]) { String firstString = "This sentence ends in 5 stars *****"; System.out.printf("Original String 1: %s\n", firstString); // replace '*' with '^' firstString = firstString.replaceAll("\\*", "^"); System.out.printf("^ substituted for *: %s\n", firstString); } }