strcspnget span until character in stringCalling Sequenceres = strcspn(string_one, string_two)Argumentsstring_one
a character string or matrix of character strings.
string_two
a character string or matrix of character strings.
resa matrix.Descriptionres = strcspn(string_one,string_two) scans
string_one for the first occurrence of any of the
characters that are part of string_two, returning
the number of characters of string_one read
before this first occurrence.
string_two must have same dimensions than string_one or string_two
must be a string.
ExamplesSee Also
strspn