Split string by list of separators and return used separator in the correct order I have built a function that splits a string by an list of separators and returns the used separator in order of usage.

This is the header of the function:

vector&lt;string&gt;* split(const string* value, const string* seperators, string* split_by)


The function is used like the following:

const string value_to_split = "000-000:000-000";
const string seperators = "-:";
string split_by;

auto parts = split(&amp;value_to_split, &amp;seperators, &amp;split_by);
delete parts;



  Example:
  
  Input
  
  
  value => 000-000:000-000
  seperators => "-:"
  
  
  Output
  
  
  return value => [ '000', '000', '000', '000' ] 
  split_by => "-:-"
  


This is the functions body:

#include &lt;string&gt;
#include &lt;vector&gt;

using std::string;
using std::vector;

vector&lt;string&gt;* split(const string* value, const string* seperators, string* split_by) {
    vector&lt;string&gt;* splited_string = new vector&lt;string&gt;;
    string current_item = "";
    for (int charIndex = 0; charIndex &lt; value-&gt;length(); charIndex++) {
        auto current_char = (*value)[charIndex];
        auto seperator_search = seperators-&gt;find(current_char);
        if (seperator_search != string::npos) {
            auto current_seperator = (*seperators)[seperator_search];
            splited_string-&gt;push_back(current_item);
            *split_by += current_seperator;
            current_item = "";
        }
        else {
            current_item += current_char;
        }
    }
    splited_string-&gt;push_back(current_item);
    return splited_string;
};


I mainly want to know if I'm using the language correctly (I'm a C# developer learning C++). But pleace also dont hestitate to tell me about anything that you would do different.
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;.