Created
March 9, 2011 20:03
-
-
Save scottfrazer/862880 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class test | |
{ | |
public static void main(String[] args) | |
{ | |
String input; | |
System.out.println("Hello, welcome to the forum. Input your post"); | |
Scanner k = new Scanner(System.in); | |
input = k.nextLine(); | |
input = input.replaceAll("([^A-Za-z])[dD][oO][gG]([^A-Za-z])","$1!@#$2"); | |
input = input.replaceAll("^[dD][oO][gG]([^A-Za-z])","!@#$1"); | |
input = input.replaceAll("([^A-Za-z])[dD][oO][gG]$","$1!@#"); | |
System.out.println("Your thread has been posted"); | |
System.out.println(input); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment