OLD :
private string Check_long(string input) { input = input.Replace("cool", "supercool"); input = input.Replace("cool1", "supercool1"); input = input.Replace("cool2", "supercool2"); input = input.Replace("cool3", "supercool3"); return input; }
NEW
private string Check_short(string input) { input = Regex.Replace(input, "cool", "supercool", RegexOptions.IgnoreCase); input = Regex.Replace(input, "cool1", "supercool1", RegexOptions.IgnoreCase); input = Regex.Replace(input, "cool2", "supercool2", RegexOptions.IgnoreCase); input = Regex.Replace(input, "cool3", "supercool3", RegexOptions.IgnoreCase); return input; }
The old solution with String.Replace worked fine. But he did not support case sensitivity. So I needed to check out Regex.Replace , but now this will not work. Why is this?
dll32
source share