Chapter16f.java
Select all
/* Chater16f.java CIS 260 David Klick 2016-02-15 This program demonstrates the String.replace method used with regular expressions. This program consists of just one statement. */ public class Chapter16f { public static void main(String[] args) { System.out.println( "The lazy dog jumped over the quick brown fox." .replaceAll("[oO][xX]", "0x0r") .replaceAll("[qQ][uU]", "kw") .replaceAll("v", "\\\\/") .replaceAll("[hH]", "|-|") .replaceAll("[mM]", "|\\\\/|") .replaceAll("[nN]", "|\\\\|") .replaceAll("w", "\\\\/\\\\/") .replaceAll("[eE]", "3") .replaceAll("[aA]", "4") .replaceAll("[iIlL]", "1") .replaceAll("[tT]", "7") .replaceAll("[b]", "6") .replaceAll("[B]", "8") .replaceAll("[oO]", "0") .replaceAll("[zZ]", "2")); } }