how to remove certain characters from a string in a file
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
how to remove certain characters from a string based on some condition ie i have a text in a file '32/4/5' i want to retain only 32 and delete rest .my condition is if a '/' is identified then rest characters should be deleted .
0 commentaires
Réponse acceptée
Kye Taylor
le 20 Déc 2012
Modifié(e) : Kye Taylor
le 20 Déc 2012
Similar to @Srinivas, you could try
str = '32/4/5';
str = regexprep(str,'/.*','');
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Characters and Strings dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!