Regular Expression Remove String With A Punctuation Beside It In A Sentence In C#
Assuming in a sentence, you want to remove the word apply now in any case. This word has a punctuation beside it.
Example:
Apply now!
Apply now.
APPLY NOW!
APPLY NOW.
apply Now!
apply Now.
In a sentence:
We are in need of VB.NET Developers. Apply Now!
We are in need of VB.NET Developers. Apply now!
We are in need of VB.NET Developers. APPLY NOW!
We are in need of VB.NET Developers. apply now!
To remove, just use the code below:
Note: I'm not a Regex expert.
Example:
Apply now!
Apply now.
APPLY NOW!
APPLY NOW.
apply Now!
apply Now.
In a sentence:
We are in need of VB.NET Developers. Apply Now!
We are in need of VB.NET Developers. Apply now!
We are in need of VB.NET Developers. APPLY NOW!
We are in need of VB.NET Developers. apply now!
To remove, just use the code below:
description = Regex.Replace(description, "apply now[!.]", string.Empty,RegexOptions.IgnoreCase).Trim();
Note: I'm not a Regex expert.
kuya greg..
ReplyDeleteAYA here..
share lang kog link.. hahha
http://www.iknowryt.com/2011/09/15/effective-asp-net-training-by-cedf-it/
Cge,
ReplyDeleteSabagay,asp.net man sad ang topic...Related pud sa blog...hehehehe... :-D