Programming
Python
R
Java
C
C++
C#
WEB
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
MORE
Examples1
Python
GO
R
Java
C
C++
C#
Examples2
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Seo Tools
Code Minifier
Code Beautifier
Language Compiler
Misc Tools
File Converter
References
C
C++
Python
Java
PHP
JavaScript
Examples
Python
R
Java
C
C++
C#
HTML
CSS
JavaScript
BootStrap4
jQuery
SVG
Home
About
Contact
JetPack
Multi Themes-->>
Code it ALL
Scroll TOP
compareToIgnoreCase() - String in java - CodeGK
Δ Java References
String
charAt()
codePointAt()
codePointBefore()
codePointCount()
compareTo()
compareToIgnoreCase()
concat()
contains()
contentEquals()
copyValueOf()
endsWith()
equals()
equalsIgnoreCase()
indexOf()
isEmpty()
lastIndexOf()
length()
replace()
startsWith()
toLowerCase()
toUpperCase()
trim()
Math
acos()
asin()
atan()
atan2()
cbrt()
ceil()
copySign()
cos()
cosh()
exp()
expm1()
floor()
hypot()
IEEEremainder()
log()
log10()
log1p()
max()
min()
pow()
random()
rint()
signum()
sin()
sinh()
sqrt()
tan()
toDegrees()
toRadians()
♦ compareToIgnoreCase() - String
♣ Example1: compareToIgnoreCase()
Input:
Run CODE
Reload Code
Copy Code
public class MyClass { public static void main(String[] args) { String str1 = "Hello World"; String str2 = "Yo Folks"; String str3 = "YO folks"; System.out.println(str1.compareToIgnoreCase(str2)); System.out.println(str2.compareToIgnoreCase(str1)); System.out.println(str2.compareToIgnoreCase(str3)); } }
Output: