How to find prefix in a sting

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Simulation, Tuning, and Visualization 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by