Add / before _ in a string
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Zeynab Mousavikhamene
am 18 Okt. 2019
Beantwortet: Bhaskar R
am 18 Okt. 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?
0 Kommentare
Akzeptierte Antwort
Bhaskar R
am 18 Okt. 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'
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!