Ask Question
10 November, 16:42

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

+3
Answers (1)
  1. 10 November, 17:32
    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?
Find 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 you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers