Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>1.</strong> <code>.ToUpper()</code> returns the string in <code>UPPERCASE</code>.<br> so that all letters in in your string variable <code>theStatus</code> becomes capital.</p> <p>basic advantage of using <code>.ToUpper()</code> is while comparing the string if you want to <code>ignore</code> the <code>case</code> (either <code>upper</code> or <code>lower</code>) you can <code>convert</code> the String to Capital using <code>.ToUpper()</code> and then compare with <code>CAPITAL</code> String.</p> <pre><code>if (theStatus.ToUpper() == "APPROVE") </code></pre> <p><strong>2.</strong> you can achieve same thing by <code>converting</code> your variable <code>theStatus</code> into <code>Lower case</code> and then compare with <code>LowerCase Letters</code> using <code>.ToLower()</code> function.</p> <pre><code>if (theStatus.ToLower() == "approve") </code></pre> <p><strong>3.</strong> You can do same thing using <code>Equals()</code> Method by passing <code>StringComparison.InvariantCultureIgnoreCase</code> so that while comparing Strings <code>Equals</code> method <code>Ignore</code> the <code>Case</code> and perform <code>Comparision</code>.</p> <p>Note : here you do not need to compare with either <code>LOWER</code> or <code>UPPER</code> case letters because <code>Equals()</code> just ignore the case and do the <code>Comparison</code>.</p> <p>1=> <code>if (theStatus.Equals("APPROVE", StringComparison.InvariantCultureIgnoreCase))</code></p> <p>2=> <code>if (theStatus.Equals("approve", StringComparison.InvariantCultureIgnoreCase))</code></p> <p>3=> <code>if (theStatus.Equals("aPpRoVe", StringComparison.InvariantCultureIgnoreCase))</code></p> <p>all of the above cases are <code>true</code> if your <code>theStatus</code> contains <code>approve</code> in any case.</p>
    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.
    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