Click here to watch in Youtube :
https://www.youtube.com/watch?v=8qpt3KNL3Og&list=UUhwKlOVR041tngjerWxVccw
Click the below Image to Enlarge
Java Tutorial : Java String [compareToIgnoreCase(String str) method] |
/* * public int compareToIgnoreCase(String str) * * Parameters: * ---------- * str - the String to be compared. * * Returns: * ------- * Returns an integer indicating whether this string * is greater than (result is > 0), equal to (result * is = 0), or less than (result is < 0) the * argument. */ public class CompareToIgnoreCaseDemo { public static void main(String[] args) { int result = "welcome".compareTo("WELCOME"); System.out.println("\"welcome\".compareTo(\"WELCOME\") = " + result); result = "welcome".compareToIgnoreCase("WELCOME"); System.out .println("\"welcome\".compareToIgnoreCase(\"WELCOME\") = " + result); } }
"welcome".compareTo("WELCOME") = 32 "welcome".compareToIgnoreCase("WELCOME") = 0
https://sites.google.com/site/javaee4321/java/StringDemo_compareToIgnoreCase_App.zip?attredirects=0&d=1
Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/StringDemo_compareToIgnoreCase_App
Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/f763f2167329fa6e35d47d9d3a5195613480d629/BasicJava/StringDemo_compareToIgnoreCase_App/?at=master
See also:
No comments:
Post a Comment