From: Wayne King on
"Mark Hard" <GerryTheLeper(a)hotmail.com> wrote in message <hl42ps$liq$1(a)fred.mathworks.com>...
> Hi,
>
> I have 2 strings, one called "nset=_PickedSet5," and one called "_PickedSet5," (both including the comma at the end) which are both read in automatically from a text file. I would like to add 2 bits of code after each of them that would make them both equal to "PickedSet5".
>
> Can anyone reccoment me a command to do this?I've tried experimenting with ismember and strread but can't seem to get it to work.
>
> Any help would be greatly appreciated.
>
> Mark.

Hi Mark, if these are your only two situations, and the "offensive" characters always occur in these locations, then you can simply set those elements of the character arrays to be empty:

A = 'nset=_PickedSet5,';
B = '_PickedSet5,';
A([1:6,end]) = [];
B([1,end]) = [];

Hope that helps,
Wayne