Ask Question
11 October, 08:50

Before using a string in a comparison, you can use either the To Upper method or the To Lower method to convert the string to upper case or lower case, respectively, and then use the converted string in the comparison. 1. True2. False

+5
Answers (1)
  1. 11 October, 12:45
    0
    True

    Explanation:

    If there's no preference over the string case (upper case or lower case), one can convert both strings to upper case or to lowercase and then compare the converted strings to test if they're equal or not.

    An Illustration is

    string a = "Boy"

    string b = 'bOy"

    if (a. ToUpper () = = b. ToUpper () || a. ToLower () = = b. ToLower ())

    {

    Print "Equal Strings"

    }

    else

    {

    Print "Strings are not equal";

    }

    The above will first convert both strings and then compare.

    Since they are the same (after conversion), the statement "Equal Strings" will be printed, without the quotes
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Before using a string in a comparison, you can use either the To Upper method or the To Lower method to convert the string to upper case or ...” in 📙 Physics if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers