I will have a different type of string(string will not have fixed format,they will be different every time) from them I want to remove some specific substring.Like the string can be
OPTIDX 26FEB2009 NIFTY CE 2500
OPTIDX NIFTY 30 Jul 2009 4600.00 PE
OPTSTK ICICIBANK 30 Jul 2009 700.00 PA
I want to extract Rs.(digit) from those string and store it into one variable and then in those string there should not be Rs.(digit).
What should be the regex for that ?
EDIT
private string ExtractingRupeesFromString(String str)
{
Match match = Regex.Match(cellRecord, @"(\d+(?:\.\d+)?)\D*$");
return match.Value.ToString();
}
for(int i=0;i<datagridview1.Rows.Count;i++)
{
datagridview1["Rs",i].Value=ExtractingRupeesFromString(datagridview1["ScriptName",i].Value.ToString());
}