| 3983 | */ |
| 3984 | |
| 3985 | String String::SubStringTo(char character, std::intmax_t startPos, bool toLast, bool include, UInt32 flags) const |
| 3986 | { |
| 3987 | if (character == '\0') |
| 3988 | return *this; |
| 3989 | |
| 3990 | std::size_t pos; |
| 3991 | if (toLast) |
| 3992 | pos = FindLast(character, startPos); |
| 3993 | else |
| 3994 | pos = Find(character, startPos, flags); |
| 3995 | |
| 3996 | if (pos == 0) |
| 3997 | return (include) ? String(character) : String(); |
| 3998 | else if (pos == npos) |
| 3999 | return *this; |
| 4000 | |
| 4001 | return SubString(0, pos+((include) ? 1 : 0)-1); |
| 4002 | } |
| 4003 | |
| 4004 | /*! |
| 4005 | * \brief Returns a sub string of the string up to a string |
no test coverage detected