Subscribe via RSS ... Subscribe via e-mail ... Follow me on Twitter ... Follow me on Facebook ...




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.Text.RegularExpressions;
 
namespace RegexTest
{
  public class RegexTest
  {
 
    static void Main()
    {
      string lText = "Kevin David Mitnick is a computer " +
                     "security consultant and author. In" +
                     " the late 20th century, he was " +
                     "convicted of various computer- and" +
                     " communications-related crimes. At" +
                     " the time of his arrest, he was " +
                     "the most-wanted computer criminal " +
                     "in the United States";
 
      Console.WriteLine("Original string : " + lText + "\n");
      lText = Regex.Replace(lText, @"\s+computer", " Nintendo Wii");
      Console.WriteLine("Processed string : " + lText);
    }
  }
}


Leave a comment


But please respect the commenting rules. Critizism is appreciated and also general comments of course. If you're rude, I have to delete your comment. Also use your personal/nick name but avoid using business names. Have fun and thanks for participating the discussion.