Compares the specified string to this string and compares the specified range of characters to determine if they are the same. @param thisStart the starting offset in this string. @param string the string to compare. @param start the starting offset in the specified
(int thisStart, String string, int start,
int length)
| 1207 | * if {@code string} is {@code null}. |
| 1208 | */ |
| 1209 | public boolean regionMatches(int thisStart, String string, int start, |
| 1210 | int length) { |
| 1211 | if (string.count - start < length || start < 0) { |
| 1212 | return false; |
| 1213 | } |
| 1214 | if (thisStart < 0 || count - thisStart < length) { |
| 1215 | return false; |
| 1216 | } |
| 1217 | if (length <= 0) { |
| 1218 | return true; |
| 1219 | } |
| 1220 | int o1 = offset + thisStart, o2 = string.offset + start; |
| 1221 | for (int i = 0; i < length; ++i) { |
| 1222 | if (value[o1 + i] != string.value[o2 + i]) { |
| 1223 | return false; |
| 1224 | } |
| 1225 | } |
| 1226 | return true; |
| 1227 | } |
| 1228 | |
| 1229 | /** |
| 1230 | * Compares the specified string to this string and compares the specified |
no test coverage detected