文字列から指定数だけ削除
118 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
文字列(string)のうしろから3文字(空白を含む)を削除したいです.
どのようにすると良いでしょうか?
例)
A=
"aaa 01"
"bbb 02"
"aaa 02"
"bbb 03"
"ccc 04"
...
削除→
A=
"aaa"
"bbb"
"aaa"
"bbb"
"ccc"
...
0 commentaires
Réponse acceptée
Dyuman Joshi
le 14 Fév 2024
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)
2 commentaires
Plus de réponses (0)
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!