Thread Subject: replacing character ' in a string

Subject: replacing character ' in a string

From: zyxuwv

Date: 15 Jun, 2009 20:19:02

Message: 1 of 3

Hello,

I would like to replace the prime in words like it's, who's etc by another character. I do not see any simple way to do it. Can someone help me?

Thanks in advance.

Eduardo

Subject: replacing character ' in a string

From: Loren Shure

Date: 15 Jun, 2009 20:25:30

Message: 2 of 3

In article <h16abm$evc$1@fred.mathworks.com>, zyxuwv@gmail.com says...
> Hello,
>
> I would like to replace the prime in words like it's, who's etc by another character. I do not see any simple way to do it. Can someone help me?
>
> Thanks in advance.
>
> Eduardo
>

x = 'it''s a go'
x(x=='''') = '%'
x =
it's a go
x =
it%s a go

--
Loren
http://blogs.mathworks.com/loren

Subject: replacing character ' in a string

From: Matt

Date: 15 Jun, 2009 20:42:02

Message: 3 of 3

Loren Shure <loren@mathworks.com> wrote in message <MPG.24a078454846384b9899de@news.mathworks.com>...
> In article <h16abm$evc$1@fred.mathworks.com>, zyxuwv@gmail.com says...
> > Hello,
> >
> > I would like to replace the prime in words like it's, who's etc by another character. I do not see any simple way to do it. Can someone help me?


See also "help strrep", which would be necessary if you were replacing string segments longer than 1 character.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
replace charact... Sprinceana 22 Jun, 2009 05:10:27
replace Sprinceana 22 Jun, 2009 05:10:27
rssFeed for this Thread

Contact us at files@mathworks.com