1 function resStr=
splitpart(inpStr,delimStr,fieldNum)
4 if ~(ischar(fieldNum)||isnumeric(fieldNum))
6 [
'fieldNum parameter is expected to be either string or a ',...
7 'value of a numeric type']);
10 strSplitList=strsplit(inpStr,delimStr);
11 nFound=length(strSplitList);
14 [
'Opps, we shouldn''t be here - the number of ',...
15 'splitted strings is zero']);
19 switch lower(fieldNum)
29 [
'a number of splitted strings (%d) is too small for a ',...
30 'specified position (%d)'],...
34 resStr=strSplitList{fieldNum};
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function splitpart(in inpStr, in delimStr, in fieldNum)
SPLITPART splits string on delimiter and return the given field (counting from one) ...