From: Donovan on
Forgive me if this question has already been answered. I was not able to find it.

I need to modify a string being used in a loop.

string = { 'the table' }

remove 'the'
so that

newString = { 'table' }

How can I do this?

Thanks for the help!
From: us on
On May 14, 12:44 am, "Donovan " <creekm...(a)gmail.com> wrote:
> Forgive me if this question has already been answered. I was not able to find it.
>
> I need to modify a string being used in a loop.
>
> string = { 'the table' }
>
> remove 'the'
> so that
>
> newString = { 'table' }
>
> How can I do this?
>
> Thanks for the help!

one of the solutions
- note: you create a CELLSTR var

s={'the table'};
r=strrep(s,'the ','')
% r = 'table' % <- a CELLSTR
% see also: regexprep

us
From: Matt Fig on
Or, to make it LESS general, but simpler:

string = { 'the table' };
Newstring = {string{1}(5:end)}
From: Donovan on
Worked perfectly, thank you!
 | 
Pages: 1
Prev: Trim command
Next: surf colormap problem