文字列から指定数だけ削除
    조회 수: 23 (최근 30일)
  
       이전 댓글 표시
    
文字列(string)のうしろから3文字(空白を含む)を削除したいです.
どのようにすると良いでしょうか?
例)
A=
"aaa 01"
"bbb 02"
"aaa 02"
"bbb 03"
"ccc 04"
...
削除→ 
A=
"aaa"
"bbb"
"aaa"
"bbb"
"ccc"
...
댓글 수: 0
채택된 답변
  Dyuman Joshi
      
      
 2024년 2월 14일
        A = ["aaa 01"
"bbb 02"
"aaa 02"
"bbb 03"
"ccc 04"]
%Number of characters from end to delete
n = 3;
B = extractBefore(A, strlength(A) - n +1)
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!