Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I recently had issues with the .net 4 upgrade but until then the simple answer is</p> <p><code>String.Trim()</code> </p> <p>removes the BOM up until .net 3.5 However in .net 4 you need to change it slightly</p> <pre><code>String.Trim(new char[]{'\uFEFF'}); </code></pre> <p>That will also get rid of the Byte order mark, though you may also want to remove the ZERO WIDTH SPACE U+200B</p> <pre><code>String.Trim(new char[]{'\uFEFF','\u200B'}); </code></pre> <p>This you could also use to remove other unwanted characters</p> <p>Some further information from <a href="http://msdn.microsoft.com/en-us/library/t97s7bs3.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/t97s7bs3.aspx</a></p> <blockquote> <p>The .NET Framework 3.5 SP1 and earlier versions maintain an internal list of white-space characters that this method trims. Starting with the .NET Framework 4, the method trims all Unicode white-space characters (that is, characters that produce a true return value when they are passed to the Char.IsWhiteSpace method). Because of this change, the Trim method in the .NET Framework 3.5 SP1 and earlier versions removes two characters, ZERO WIDTH SPACE (U+200B) and ZERO WIDTH NO-BREAK SPACE (U+FEFF), that the Trim method in the .NET Framework 4 and later versions does not remove. In addition, the Trim method in the .NET Framework 3.5 SP1 and earlier versions does not trim three Unicode white-space characters: MONGOLIAN VOWEL SEPARATOR (U+180E), NARROW NO-BREAK SPACE (U+202F), and MEDIUM MATHEMATICAL SPACE (U+205F).</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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