diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java index b636dac46..a11ed0585 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TString.java @@ -162,6 +162,18 @@ public class TString extends TObject implements TSerializable, TComparable length() || ooffset + len > other.length()) { + return false; + } + for (int i = 0; i < len; ++i) { + char a = charAt(toffset++); + char b = other.charAt(ooffset++); + if (ignoreCase) { + a = TCharacter.toLowerCase(a); + b = TCharacter.toLowerCase(b); + } + if (a != b) { + return false; + } + } + return true; + } + public boolean regionMatches(int toffset, TString other, int ooffset, int len) { if (toffset < 0 || ooffset < 0 || toffset + len > length() || ooffset + len > other.length()) { return false; @@ -626,4 +656,12 @@ public class TString extends TObject implements TSerializable, TComparable