@@ -165,6 +165,14 @@ namespace pystring
165165 // /
166166 std::string lstrip ( const std::string & str, const std::string & chars = " " );
167167
168+ // ////////////////////////////////////////////////////////////////////////////////////////////
169+ // / @brief Split the string around first occurance of sep.
170+ // / Three strings will always placed into result. If sep is found, the strings will
171+ // / be the text before sep, sep itself, and the remaining text. If sep is
172+ // / not found, the original string will be returned with two empty strings.
173+ // /
174+ void partition ( const std::string & str, const std::string & sep, std::vector< std::string > & result );
175+
168176 // ////////////////////////////////////////////////////////////////////////////////////////////
169177 // / @brief Return a copy of the string with all occurrences of substring old replaced by new. If
170178 // / the optional argument count is given, only the first count occurrences are replaced.
@@ -190,6 +198,14 @@ namespace pystring
190198 // /
191199 std::string rjust ( const std::string & str, int width);
192200
201+ // ////////////////////////////////////////////////////////////////////////////////////////////
202+ // / @brief Split the string around last occurance of sep.
203+ // / Three strings will always placed into result. If sep is found, the strings will
204+ // / be the text before sep, sep itself, and the remaining text. If sep is
205+ // / not found, the original string will be returned with two empty strings.
206+ // /
207+ void rpartition ( const std::string & str, const std::string & sep, std::vector< std::string > & result );
208+
193209 // ////////////////////////////////////////////////////////////////////////////////////////////
194210 // / @brief Return a copy of the string with trailing characters removed. If chars is "", whitespace
195211 // / characters are removed. If not "", the characters in the string will be stripped from the
0 commit comments