Tests if this string ends with the specified suffix.
(java.lang.String suffix)
| 248 | * Tests if this string ends with the specified suffix. |
| 249 | */ |
| 250 | public boolean endsWith(java.lang.String suffix){ |
| 251 | if(suffix.length() > length()) { |
| 252 | return false; |
| 253 | } |
| 254 | int offset = suffix.length() - 1; |
| 255 | for(int iter = length() - 1 ; offset >= 0 ; iter--) { |
| 256 | if(value[this.offset + iter] != suffix.value[suffix.offset + offset]) { |
| 257 | return false; |
| 258 | } |
| 259 | offset--; |
| 260 | } |
| 261 | return true; |
| 262 | } |
| 263 | |
| 264 | /** |
| 265 | * Compares this string to the specified object. The result is true if and only if the argument is not null and is a String object that represents the same sequence of characters as this object. |