In one of the forum post, the poster asked to
Solution:
- Remove all the special character
- Then Remove the space and replace with _ (underscore) character
Solution:
string yourInput = "Levi Jeans (Blue) & yellow 101 - 150Ah"; Regex rgx = new Regex(@"[^a-zA-Z\d\s]"); // Replace Special Charater and space with emptystring string finalOutput = rgx.Replace(yourInput,""); Console.WriteLine(finalOutput); Regex rgx1 = new Regex("\\s+"); // Replace space with underscore finalOutput = rgx1.Replace(finalOutput, "_");