Hi,
I want the user to pass YMF1 word from the console.
Then I need a regular expression to check the below string which includes some apostrophes:
'YMF1 ' 103200 'REAL'
and remove the "second" apostrophe in that string and return true if it can match the exact standalone word 'YMF1 which was read from the console?
( I want also to make a differentiation between YMF1 and YMF10 for example) .
thanks
Loading
yamidPosted May 16, 2011, 3:46 PM
FroglegPosted May 16, 2011, 3:15 PM
namespace StringCheck
{
class Program
{
static void Main(string[] args)
{
string str = ("'YMF1 ' 103200 'REAL'");
string strR = str.Replace(" " ,"");
string[] strM = strR.Split('\'');
if (strM[1]=="YMF1")
{
Console.WriteLine("Its a match with " + strM[1]);
}
}
}
}