フィルターのクリア

How to find prefix in a sting

2 ビュー (過去 30 日間)
cat cat
cat cat 2016 年 1 月 11 日
コメント済み: Stephen23 2016 年 1 月 11 日
Hi! I have a vector of strings and I want to find the prefix
Ex 0234567 --> prefix 0
How can I do?

採用された回答

Stephen23
Stephen23 2016 年 1 月 11 日
編集済み: Stephen23 2016 年 1 月 11 日
Use indexing:
>> str = '0234567';
>> str(1)
ans = 0
  2 件のコメント
cat cat
cat cat 2016 年 1 月 11 日
If I want to put the results in 2 vector: one prefix, two postfix, how can I do? Thanks
Stephen23
Stephen23 2016 年 1 月 11 日
>> str = '01234567';
>> prf = str(1)
prf = 0
>> pof = str(2:end)
pof = 1234567

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulation, Tuning, and Visualization についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by