| 674 | } |
| 675 | |
| 676 | String::size_type String::find(char ch, size_type pos) const { |
| 677 | const char* begin = c_str(); |
| 678 | const char* end = begin + size(); |
| 679 | const char* it = begin + pos; |
| 680 | for (; it < end && *it != ch; it++); |
| 681 | if (it < end) { return static_cast<size_type>(it - begin); } |
| 682 | else { return npos; } |
| 683 | } |
| 684 | |
| 685 | String::size_type String::rfind(char ch, size_type pos) const { |
| 686 | const char* begin = c_str(); |
no test coverage detected