not case-sensitive string.Replace()
-
How can i perfom case-NONsensitive replacing in string? Advice, please.. -- Digitally yours, Bounz
-
Give an example, please.:-O I want Replace() to find "thurman" in "Uma Thurman"... How can I implement this? -- Digitally yours, Bounz
pattern like [Tt]hurman will work
Regex rx=new Regex("[Tt]est"); string strRep=rx.Replace("Test test testable Mohhahahah","XZXXX"); MessageBox.Show(strRep);
MCAD
-
pattern like [Tt]hurman will work
Regex rx=new Regex("[Tt]est"); string strRep=rx.Replace("Test test testable Mohhahahah","XZXXX"); MessageBox.Show(strRep);
MCAD
-
thanks a lot to all.. i found answer: i have to use
Regex rx = new Regex("(?i)WhatIWantToReplace"); string strRep = rx.Replace("TextInWhichReplace", "WithWhichReplace");
-- Digitally yours, Bounzif you dont know the first character use [\ws] which mean any character so pattern would be like this [\ws]est which will match test and best and so on MCAD
-
Give an example, please.:-O I want Replace() to find "thurman" in "Uma Thurman"... How can I implement this? -- Digitally yours, Bounz
-
Simply: string result = Regex.Replace("Uma Thurman", "thurman", "whatever", RegexOptions.IgnoreCase); --- b { font-weight: normal; }