Borrar filtros
Borrar filtros

How to find prefix in a sting

2 visualizaciones (últimos 30 días)
cat cat
cat cat el 11 de En. de 2016
Comentada: Stephen23 el 11 de En. de 2016
Hi! I have a vector of strings and I want to find the prefix
Ex 0234567 --> prefix 0
How can I do?

Respuesta aceptada

Stephen23
Stephen23 el 11 de En. de 2016
Editada: Stephen23 el 11 de En. de 2016
Use indexing:
>> str = '0234567';
>> str(1)
ans = 0
  2 comentarios
cat cat
cat cat el 11 de En. de 2016
If I want to put the results in 2 vector: one prefix, two postfix, how can I do? Thanks
Stephen23
Stephen23 el 11 de En. de 2016
>> str = '01234567';
>> prf = str(1)
prf = 0
>> pof = str(2:end)
pof = 1234567

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulation, Tuning, and Visualization en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by