Results 1 to 4 of 4

Thread: String Replace

Threaded View

  1. #4
    Fanatic Member
    Join Date
    Aug 2010
    Posts
    624

    Re: String Replace

    Try this

    Code:
    Regex.Replace(sHTMLstream, "\bvb\b", "C#", RegexOptions.IgnoreCase)
    I just tested it and it worked aok.

    The reason yours didn't work was because of your pattern.

    Code:
    pattern = "\\bvb\b"
    you put two slashes before the first wordboundary, a double slash is when you wish to include a slash literal (i.e your match will contain a "\" so you don't want the metacharacter) In effect, the pattern YOUR RegEx was looking for was the literal: "\bvb", which isn't what you want.
    Last edited by J-Deezy; Dec 23rd, 2010 at 05:03 AM.
    If I helped you out, please take the time to rate me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width