function [parts]=parseStringOnToken(string,token)
%PARSESTRINGONTOKEN   separates <string> into <parts> based on a separation <token>
%
% input:
%   string
%   token
%
% output:
%   parts

% -------------------------------------------------------------
% Copyright (c) WL|Delft Hydraulics 2004-2007 FOR INTERNAL USE ONLY
% Version:      Version 1.0, February 2006 (Version 1.0, February 2006)
% By:           <M. van Koningsveld (email: mark.vankoningsveld@wldelft.nl>
% -------------------------------------------------------------


for i=1:size(string,1)
    if i==1 & size(string,1)==1
        if iscell(string)
            toparse=string{i};
        else
            toparse=string;
        end
    else
        toparse=string{i};
    end
    partnr=1;
    while ~isempty(toparse)
        [part,toparse]=strtok(toparse,token);
        parts{i,partnr} = part;
        partnr=partnr+1;
    end
end