stok - string tokenizer

Find the addresses of tokens in the strings
1.5K Downloads
Updated 25 Oct 2006

No License

%******************************************************************************
% function stok
% Purpose: Find the addresses of tokens in the strings
% Input:
% str - character string to be searched for tokens
% delim - character string holding the token delimiters
% maxtok - maximum allowed number of tokens
% Output:
% strtok - return the number of tokens in the string
% istart - integer array holding the token starting positions in str
% iend - integer array holding the token ending positions in str
% Usage example:
% str='ab;cd de=0'; delim='; ='; [istart, iend] = stok(str, '; =')
% istart =
% 1 4 7 10
% iend =
% 2 5 8 10
% str(istart(1):iend(1))
% ans =
% ab

Cite As

Michael Yoshpe (2026). stok - string tokenizer (https://uk.mathworks.com/matlabcentral/fileexchange/12778-stok-string-tokenizer), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R12
Compatible with any release
Platform Compatibility
Windows macOS Linux
Version Published Release Notes
1.0.0.0