MATLAB: Regexprep() skip first occurrence

regexprep

Is there a way to use regexprep() but skip the first occurrence of a space?
mystring = 'this is my string';
desired return:
mystring2 = 'this ismystring';

Best Answer

How about using regexp to find the position of spaces, and delete 2nd~Nth spaces? Like:
mystring = 'this is my string';
pos = regexp(mystring,'\s');
mystring(pos(2:end)) = [];
Related Question