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

 Réponse acceptée

Bhaskar R
Bhaskar R le 18 Oct 2019

0 votes

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'

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by