In this section, you will get the detailed explanation about the
method of String class. We are going to use equalsIgnoreCase(String Str)
method of String class in Java. The description of the code is given below for the usage of the method.
Description of the code:
As shown in the example below we have taken three strings i.e. str1, str2 and str3. Then we have applied the equalsIgnoreCase(String Str) method to compare these three strings. This method shows whether two String objects contain the same data, ignoring the case of the letters in the String. Hence we get the following output.
If atleast one of the following is true then only two characters c1 and c2 are considered the same, ignoring case.
Here is the code of the program:
"bon voyage" equals "Bon Appetit"? false
"bon voyage" equals "Bon Voyage"? true
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: February 27, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles