replace one word with another one in a string

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일

0 개 추천

strrep(s,'background','hello');

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

질문:

2011년 9월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by