File Exchange

image thumbnail

splitstring

version 1.0.0.0 (1.53 KB) by Ivar Eskerud Smith
Split a string into a cell array by specifying a delimiter.

1 Download

Updated 02 Mar 2012

View License

Split a string into a cell array by specifying a delimiter. Empty entries can be excluded if specified. Space delimiter is assumed if none is specified.
Ex:
arr = splitstring( 'a,b,c,d', ',' )

Cite As

Ivar Eskerud Smith (2021). splitstring (https://www.mathworks.com/matlabcentral/fileexchange/35418-splitstring), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

milad eshkevari

DS

If you have Matlab(2006a) or newer, you can use the 'split' option of the builtin function REGEXP to split a string into a cell array of substrings, like so:
parts = regexp(myText,’\s+’,'split’);

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!