예제 #1
0
    static void Main()
    {
        Console.WriteLine("Input the text:");
        string text = Console.ReadLine();

        Console.WriteLine("Input the word or part the word needs to be replaced");
        string word = Console.ReadLine();

        Console.WriteLine("Input the replacer word");
        string replacer = Console.ReadLine();

        Console.WriteLine(Replacer.FindAndReplace(text, word, replacer));
    }
 public void FindAndReplace_ReplaceWordPieceInText_ChangedText()
 {
   Assert.AreEqual("I am walking my dog to the doghedral", Replacer.FindAndReplace("I am walking my cat to the cathedral", "cat", "dog"));
 }
 public void FindAndReplace_ReplaceWordInText_ChangedText()
 {
   Assert.AreEqual("Hello universe", Replacer.FindAndReplace("Hello world", "world", "universe"));
 }