Compares a CharSequence to this String to determine if their contents are equal. @param cs the character sequence to compare to. @return true if equal, otherwise false @since 1.5
(CharSequence cs)
| 1707 | * @since 1.5 |
| 1708 | */ |
| 1709 | public boolean contentEquals(CharSequence cs) { |
| 1710 | int len = cs.length(); |
| 1711 | |
| 1712 | if (len != count) { |
| 1713 | return false; |
| 1714 | } |
| 1715 | |
| 1716 | if (len == 0 && count == 0) { |
| 1717 | return true; // since both are empty strings |
| 1718 | } |
| 1719 | |
| 1720 | return regionMatches(0, cs.toString(), 0, len); |
| 1721 | } |
| 1722 | |
| 1723 | /** |
| 1724 | * Determines whether this string matches a given regular expression. |
nothing calls this directly
no test coverage detected