how to remove certain characters from a string in a file
조회 수: 4 (최근 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!