MATLAB: Last letter in a string

strings

I have a string that is going to keep updating
Say x='ear' how do I take the last later in the string so say lastletter='r' is it possible to have this work generally to always take the last later in a the string so say x gets updated to 'eart' lastletter=-t'

Best Answer

x = 'ear';
lastletter = x(end);