String a = "Hello\u200e"; String b = "Hello\u200f"; System.out.println("a = '" + a + "' and b = '" + b + "' are length " + a.length() + " and " + b.length() + ", equals() is " + a.equals(b));
The code in the above code snippet produces the following output.
a = 'Hello' and b = 'Hello' - lengths 6 and 6, equals () - false
Although the value of both a and b displayed on the console is Helloβ a.equals(b) returns false . How?
Tiny
source share