replace one word with another one in a string

조회 수: 1 (최근 30일)
zhang
zhang 2011년 9월 20일
Hi guys
I'd like to replace one word with another one in a string. For example:
s = 'C:\myproject\data\background\view1\rgb'; I'd like to replace "background" with "hello"
Is there any function can do this?
Thanks in advanced

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2011년 9월 20일
strrep(s,'background','hello');

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by