Azzera filtri
Azzera filtri

Add / before _ in a string

1 visualizzazione (ultimi 30 giorni)
Zeynab Mousavikhamene
Zeynab Mousavikhamene il 18 Ott 2019
Risposto: Bhaskar R il 18 Ott 2019
I need to add / before any underline in strings like "Mean_Tumor_Radius_prolif" so it will be "Mean/_Tumor/_Radius/_prolif".
Any suggestion?

Risposta accettata

Bhaskar R
Bhaskar R il 18 Ott 2019
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'

Più risposte (0)

Categorie

Scopri di più su Characters and Strings in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by