regular expression in Csharp

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

Hi all,

I have an if then statement to delete the following file in my computer,
country=US!state=NY.txt

let's say "country=US" is variable

if (objFL.ToUpper().IndexOf(variable+"!",0)>=0

{delete the file }

But if there are some spaces between variable and ! (like file format
below), then condition will fail as it can't find the match.

country=US !state=NY.txt


how do I use regular expression so I can do match "variable(spaces or no
spaces)!"
 
Back
Top