MATLAB: How to find prefix in a sting

prefixstrings

Hi! I have a vector of strings and I want to find the prefix
Ex 0234567 –> prefix 0
How can I do?

Best Answer

Use indexing:
>> str = '0234567';
>> str(1)
ans = 0