FA/ReplacerTest

From ggc

Jump to: navigation, search

01 package FA;
02 
03 
04 /**
05  * This program checks to see if the methods in Replacer class work.
06  @author My Frank Anderson
07  */
08 public class ReplacerTest
09 {
10   public static void main(String[] args)
11   {
12 
13     /** source is the string in which replacments will occur. */
14     String source = "ababccabababc";
15     /** repl is the expresson which will replace the targed in the source string. */
16     String repl = "XXX";
17     /** target  is the string to be will be replaced in the source string.*/
18     String target = "abc";
19     /**string2  will hold the output from the Replacer class.  */
20     String string2=""
21                    ;
22 
23     Replacer model = new Replacer(target, repl);
24 
25     string2 = model.getReplaced(source);
26 
27     System.out.println("Desired output: abXXXcababXXX");
28     System.out.print(" Actual output: ");
29     System.out.println(string2);
30 
31   }
32 }


Download/View FA/ReplacerTest.java





Views
Personal tools
Add to 
del.icio.usAdd to 
diggAdd to 
FacebookAdd to 
favoritesAdd to 
GoogleAdd to 
MySpaceAdd to 
PrintAdd to 
SlashdotAdd to 
StumbleUponAdd to 
Twitter