ssortingng inputSsortingng = "1/10 EP Sp'arrowha?wk XT R;TR 2.4GHz Red"; //Characters Collection: (';', '\', '/', ':', '*', '?', ' " ', '', '|', '&', ''') ssortingng outputSsortingng = "1 10 EP Sp arrowha wk XT R TR 2.4GHz Red";
Divulgation complète concernant le code suivant:
new Regex(...)
; Je ne connais pas vraiment C #, mais je peux utiliser Google pour "C# ssortingng replace regex"
et atterrir sur MSDN.
Regex re = new Regex("[;\\/:*?\"<>|&']"); string outputString = re.Replace(inputString, " ");
Voici le code correct:
ssortingng inputSsortingng = "1/10 EP Sp'arrowha?wk XT R;TR 2.4GHz R\\ed"; Regex re = new Regex("[;\\\\/:*?\"<>|&']"); string outputString = re.Replace(inputString, " "); // outputString is "1 10 EP Sp arrowha wk XT R TR 2.4GHz R ed"
Démo: http://ideone.com/hrKdJ
ssortingng outputSsortingng = Regex.Replace(inputSsortingng,"[;\/:*?""<>|&']",String.Empty)