rsplit

Splits a delimited string into a cell array using a regular expression.
2,2K descargas
Actualizado 7 jun 2007

Sin licencia

%L=RSPLIT(R,S)
% Splits a string S using the regular expression R. Meant to work like
% the PERL split function. Returns a cell array of strings. Requires
% REGEXP.
%
% This function acts a bit like a dual to REGEXP: it returns all of the
% strings that don't match the regular expression instead of those that
% do match. STRREAD is similar to RSPLIT, but it uses a fixed delimiter
% set (whitepace) when use '%s'.
%
%Examples:
% >> rsplit('[_/]+', 'this_is___a_/_string/_//')
% ans =
% 'this' 'is' 'a' 'string'
%
% >> rsplit(',', '$GPGGA,012911.00,7111.04510,N,15841.80861,W')
% ans =
% '$GPGGA' '012911.00' '7111.04510' 'N' '15841.80861' 'W'
%
% >> rsplit(',', '')
% ans =
% {}
%
% >> rsplit(',', ',')
% ans =
% {}
%
% >> rsplit('\s+',' 47.590516667 N 122.341633333 W 1 4 ')
% ans =
% '' '47.590516667' 'N' '122.341633333' 'W' '1' '4'
%
%Implementation inspired by
% Val Schmidt, Center for Coastal and Ocean Mapping
% University of New Hampshire
%
%by Gerald Dalley (dalleyg@mit.edu), 2007

Citar como

Gerald Dalley (2024). rsplit (https://www.mathworks.com/matlabcentral/fileexchange/15226-rsplit), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2006a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Characters and Strings en Help Center y MATLAB Answers.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0