how to delete the dot in a string
11 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
like bbc.ed.123.f.txt how to change it to bbced123f.txt
0 Commenti
Risposta accettata
Andrei Bobrov
il 21 Gen 2014
Modificato: Andrei Bobrov
il 21 Gen 2014
a = 'bbc.ed.123.f.txt';
regexprep(a,{'\.','txt'},{'','.txt'})
or
[strrep(a(1:end-4),'.',''),'.txt']
Più risposte (1)
ES
il 21 Gen 2014
you have to handle the last dot(before file extension) and the other dots separately.
str='bbc.ed.123.f.txt';
idx=strfind(str,'.');
new_str=[strrep(str(1:idx(end)-1),'.',''),str(idx(end):end)];%idx(end) is the position of the last dot!
0 Commenti
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!