Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>if its just a matter of SPACE;</p> <p>try this Source : <a href="http://www.codeproject.com/Articles/10890/Fastest-C-Case-Insenstive-String-Replace" rel="nofollow">http://www.codeproject.com/Articles/10890/Fastest-C-Case-Insenstive-String-Replace</a></p> <pre><code> private static string ReplaceEx(string original, string pattern, string replacement) { int count, position0, position1; count = position0 = position1 = 0; string upperString = original.ToUpper(); string upperPattern = pattern.ToUpper(); int inc = (original.Length / pattern.Length) * (replacement.Length - pattern.Length); char[] chars = new char[original.Length + Math.Max(0, inc)]; while ((position1 = upperString.IndexOf(upperPattern, position0)) != -1) { for (int i = position0; i &lt; position1; ++i) chars[count++] = original[i]; for (int i = 0; i &lt; replacement.Length; ++i) chars[count++] = replacement[i]; position0 = position1 + pattern.Length; } if (position0 == 0) return original; for (int i = position0; i &lt; original.Length; ++i) chars[count++] = original[i]; return new string(chars, 0, count); } </code></pre> <p>Usage:</p> <pre><code> string original_string = "Hello , how are you ?"; while (original_string.Contains(" ")) { original_string = ReplaceEx(original_string, " ", " "); } </code></pre> <p>Replacing the regex way:</p> <pre><code>string resultString = null; try { resultString = Regex.Replace(subjectString, @"\s+", " ", RegexOption.Compiled); } catch (ArgumentException ex) { // Syntax error in the regular expression } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload