From: Meedo on
Hi,

How can i replace a char by another one using its index.

e.g.

s='matlab'
s1='a';
s2='A';

How to replace only the first a (index 2 in the s string) with A, to be

ans= mAtlab

Does Matlab provides this kind of string indexing??

i appreciate any comments..

Mohammad
From: Walter Roberson on
Meedo wrote:

> How can i replace a char by another one using its index.
>
> e.g.
>
> s='matlab'
> s1='a';
> s2='A';
>
> How to replace only the first a (index 2 in the s string) with A, to be
>
> ans= mAtlab
>
> Does Matlab provides this kind of string indexing??
> i appreciate any comments..


A(find(A='a',1)) = 'A';