Prev: Is there any readymade function by which part of a string can beextracted?
Next: Is there any readymade function by which part of a string canbe extracted?
From: John D'Errico on 13 Feb 2010 11:38 Samiran <samiran.iitkgp(a)gmail.com> wrote in message <1857484702.185654.1266078597050.JavaMail.root(a)gallium.mathforum.org>... > Is there any readymade function by which part of a string can be extracted? like almost every other programming language has methods like 'substring'/'substr' to extract a part from a string based upon the start and end index???? A string is just a vector or an array. So use the standard indexing methods in matlb. S = 'qwertyuiop'; S(3:5) ans = ert John
From: Donn Shull on 13 Feb 2010 11:42
Samiran <samiran.iitkgp(a)gmail.com> wrote in message <1857484702.185654.1266078597050.JavaMail.root(a)gallium.mathforum.org>... > Is there any readymade function by which part of a string can be extracted? like almost every other programming language has methods like 'substring'/'substr' to extract a part from a string based upon the start and end index???? >> str = 'This is a string' str = This is a string >> substring1 = str(1:4) substring1 = This >> substring2 = str(11:end) substring2 = string >> |