Ask Question
21 January, 03:59

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

+2
Answers (1)
  1. 21 January, 04:18
    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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers