how to remove certain characters from a string in a file
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Kye Taylor
2012 年 12 月 20 日
編集済み: Kye Taylor
2012 年 12 月 20 日
Similar to @Srinivas, you could try
str = '32/4/5';
str = regexprep(str,'/.*','');
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!