You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/java/com/javaquery/util/string/Strings.java
+20-2Lines changed: 20 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -212,6 +212,24 @@ public static void notEquals(String a, String b, ExecutableFunction executableFu
212
212
}
213
213
}
214
214
215
+
/**
216
+
* Compares this String to another String, ignoring case considerations. Two strings are considered equal ignoring case if they are of the same length and corresponding characters in the two strings are equal ignoring case.
217
+
* Two characters c1 and c2 are considered the same ignoring case if at least one of the following is true:
218
+
* <ul>
219
+
* <li>The two characters are the same (as compared by the == operator)</li>
220
+
* <li>Calling Character.toLowerCase(Character.toUpperCase(char)) on each character produces the same result</li>
221
+
* </ul>
222
+
*
223
+
* @param a String
224
+
* @param b String to be compared with {@code a} for equality (ignoring case considerations)
225
+
* @return {@code true} if the provided Strings are equalsIgnoreCase otherwise
* Compares this String to another String, ignoring case considerations. Two strings are considered equal ignoring case if they are of the same length and corresponding characters in the two strings are equal ignoring case.
217
235
* Two characters c1 and c2 are considered the same ignoring case if at least one of the following is true:
@@ -225,7 +243,7 @@ public static void notEquals(String a, String b, ExecutableFunction executableFu
225
243
* @param executableFunction lambda function given executed if the provided Strings are equals (ignoring case considerations).
Assertions.assertThrows(RuntimeException.class, () -> Strings.equalsIgnoreCase("A", "A", () -> {thrownewRuntimeException("Function executed when two Strings are equalsIgnoreCase");}));
120
129
Assertions.assertThrows(RuntimeException.class, () -> Strings.equalsIgnoreCase("A", "a", () -> {thrownewRuntimeException("Function executed when two Strings are equalsIgnoreCase");}));
121
130
Strings.equalsIgnoreCase("A", "b", () -> {thrownewRuntimeException("Function won't execute when two Strings are not equalsIgnoreCase");});
0 commit comments