I need to add / before any underline in strings like "Mean_Tumor_Radius_prolif" so it will be "Mean/_Tumor/_Radius/_prolif".
Any suggestion?

 채택된 답변

Bhaskar R
Bhaskar R 2019년 10월 18일

0 개 추천

There are many ways to do this, the simplest way is by the command "strrep"
str = 'Mean_Tumor_Radius_prolif'
replaced_str = strrep(str, '_', '/_');
replaced_str =
'Mean/_Tumor/_Radius/_prolif'

추가 답변 (0개)

카테고리

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

태그

질문:

2019년 10월 18일

답변:

2019년 10월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by