Split string by list of separators and return used separator in the correct order
The standard library offers strstr.
It seems more natural to look for separators in the string, rather for string characters in separators.
value and separators better be passed as const std::string&amp; to make sure they are not attempted to be mutated.
Out parameters are typically frowned upon. Consider returning an std::pair&lt;std::vector&lt;string&gt;, std::vector&lt;char&gt;&gt;.