image thumbnail

extract substring

version 1.0.0.0 (1.69 KB) by Phillip M. Feldman
substr extracts a substring of length len from the string str, starting at the specified offset.

3.9K Downloads

Updated 18 Aug 2009

View License

substr extracts a substring of length len from the string str, starting at the specified offset. In this version, the first character position has offset 1. (In Acklam's original code, the first character position has offset 0, but this is inconsistent with Matlab conventions). If offset is negative, the position is reckoned by counting backwards from the end of the string. If len is omitted, substr returns everything to the end of the string. If len is negative, substr removes -len characters from the end of the string.

Cite As

Phillip M. Feldman (2021). extract substring (https://www.mathworks.com/matlabcentral/fileexchange/25064-extract-substring), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2008b
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!