필터 지우기
필터 지우기

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 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