title: Xamarin Comparison between string list and label Text
body: <p>I am a novice in Xamarin, I have a list of two strings and I want to compare if the elements of the list in lower case are equal to elements of a label in lower case. </p>
  
  <p>When I add <code>.ToLower()</code> to a element of a label, the debug stop and I do not know why.</p>
  
  <p>Here is my code :</p>
  
  <pre><code>Dictionary&lt;int, string&gt; WordsList = new Dictionary&lt;int, string&gt;();
  Dictionary&lt;int, string&gt; WordsList2 = new Dictionary&lt;int, string&gt;();
  
  public TestWords()
  {
     InitializeComponent();
  
     mywordsdatabase = new MyWordsDatabase();
  
     var mywords = mywordsdatabase.GetWords();
  
     int i = 0;
  
     // TestAnswer.IsVisible = false;
     foreach (var myword in mywords)
     {
         WordsList[i] = myword.Word1;
         WordsList2[i] = myword.Word2.ToLower(); // this is ok
  
         i++;
     }
  
     word10.Text = WordsList[0];
     word11.Text = WordsList[1];
  
     word20.Focus(); 
     word21.Focus();
  }
  
  //Correction for the test
  void OnOKTest(object sender, EventArgs args)
  {
       int yes = 0;
       int no = 0;
  
       //############ if == #############
       if (WordsList2[0] == word20.Text.ToLower())  // but this is not accepted
       {
           true0.Text = "✔";
           yes++;
       }
  
       if (WordsList2[1] == word21.Text.ToLower())  // but this is not accepted
       {
           true1.Text = "✔";
           yes++;
       }
  } 
  </code></pre>
  
  <p>Here is my xaml:</p>
  
  <pre><code>&lt;Grid VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Padding="5"&gt;
      &lt;Grid.RowDefinitions&gt;
          &lt;RowDefinition Height="*" /&gt;
          &lt;RowDefinition Height="*" /&gt;
      &lt;/Grid.RowDefinitions&gt;
      &lt;Grid.ColumnDefinitions&gt;
          &lt;ColumnDefinition Width="*" /&gt;
          &lt;ColumnDefinition Width="*" /&gt;
      &lt;/Grid.ColumnDefinitions&gt;
  
      &lt;Label x:Name="word10" Text="Your Text" FontSize="20" Grid.Row="0" Grid.Column="0" /&gt;
      &lt;Label x:Name="word11" Text="Your Text" FontSize="20" Grid.Row="1" Grid.Column="0" /&gt;
      &lt;Entry x:Name="word20" Placeholder="The word traduction" FontSize="20" Grid.Row="0" Grid.Column="2" &gt;&lt;/Entry&gt;
      &lt;Entry x:Name="word21" Placeholder="The word traduction" FontSize="20" Grid.Row="1" Grid.Column="2" &gt;&lt;/Entry&gt;
      &lt;Label x:Name="true0" Text="" FontSize="20"  Grid.Row="0" Grid.Column="3" /&gt;
      &lt;Label x:Name="true1" Text="" FontSize="20"  Grid.Row="1" Grid.Column="3" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>Thanks</p>