| 3805 | } |
| 3806 | |
| 3807 | bool String::ends_with(const String& p_string) const |
| 3808 | { |
| 3809 | int l = p_string.length(); |
| 3810 | if (l > length()) |
| 3811 | { |
| 3812 | return false; |
| 3813 | } |
| 3814 | |
| 3815 | if (l == 0) |
| 3816 | { |
| 3817 | return true; |
| 3818 | } |
| 3819 | |
| 3820 | const char32_t* p = &p_string[0]; |
| 3821 | const char32_t* s = &operator[](length() - l); |
| 3822 | |
| 3823 | for (int i = 0; i < l; i++) |
| 3824 | { |
| 3825 | if (p[i] != s[i]) |
| 3826 | { |
| 3827 | return false; |
| 3828 | } |
| 3829 | } |
| 3830 | |
| 3831 | return true; |
| 3832 | } |
| 3833 | |
| 3834 | bool String::begins_with(const String& p_string) const |
| 3835 | { |
no test coverage detected