diff --git a/src/edu/first/util/Strings.java b/src/edu/first/util/Strings.java index 7b37ad7..125f613 100644 --- a/src/edu/first/util/Strings.java +++ b/src/edu/first/util/Strings.java @@ -38,11 +38,11 @@ public static boolean isEmpty(String string) { public static int indexThatIsnt(String string, String s, String i) { int index; int spare = 0; - while ((index = string.indexOf(s)) > 0 && index == string.indexOf(i)) { + while ((index = string.indexOf(s)) >= 0 && index == string.indexOf(i)) { string = string.substring(index + i.length()); spare += index + i.length(); } - return index + spare; + return index < 0 ? -1 : index + spare; } /**