title: Why isn't indexOf working for me? (indexOf is culture aware and missing a string comparison argument)
body: <p>I'm trying to use <code>IndexOf</code> as given in the example here:</p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/k8b1470s(v=vs.110).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/k8b1470s(v=vs.110).aspx</a></p>
  
  <p>If you scroll down it shows the example:  </p>
  
  <pre><code>  string s1 = "ani\u00ADmal";
    string s2 = "animal";
  
    // Find the index of the soft hyphen.
    Console.WriteLine(s1.IndexOf("\u00AD"));
    Console.WriteLine(s2.IndexOf("\u00AD"));
  </code></pre>
  
  <p>I am trying to execute that from <code>Main(string[] args)</code> and I get the compilation error, <code>IndexOf</code> is culture aware and missing a string comparison argument." I have imported <code>using System;</code> and <code>using System.IO;</code> and I'm using Visual Studio on a Mac. Am I missing something?</p>
  
  <p>EDIT: Alright, the explanation of the problem can be found under "remarks":</p>
  
  <blockquote>
    <p>This method performs a word (case-sensitive and culture-sensitive)
    search using the current culture. The search begins at the first
    character position of this instance and continues until the last
    character position.</p>
    
    <p>Character sets include ignorable characters, which are characters that
    are not considered when performing a linguistic or culture-sensitive
    comparison. In a culture-sensitive search, if value contains an
    ignorable character, the result is equivalent to searching with that
    character removed. If value consists only of one or more ignorable
    characters, theIndexOf(String) method always returns 0 (zero) to
    indicate that the match is found at the beginning of the current
    instance. In the following example, the IndexOf(String) method is used
    to find three substrings (a soft hyphen (U+00AD), a soft hyphen
    followed by "n", and a soft hyphen followed by "m") in two strings.
    Only one of the strings contains a soft hyphen. If the example is run
    on the .NET Framework 4 or later, in each case, because the soft
    hyphen is an ignorable character, the result is the same as if the
    soft hyphen had not been included in value. When searching for a soft
    hyphen only, the method returns 0 (zero) to indicate that it has found
    a match at the beginning of the string.</p>
  </blockquote>