MATLAB: Last Letter in a Text string text strings If I have a Text String TS1='%@3Gb6' and I want the last alphabetic character to be printed out (in this case b) what function(s) should I use to accomplish this? Best Answer This works:LastLetter = TS1(max(regexp(TS1, '[A-Za-z]'))); Related SolutionsMATLAB: Last letter in a string x = 'ear'; lastletter = x(end); MATLAB: How to convert a 2-D char to string Is this what you mean? >> C=['abcde';'fghij'] C = abcde fghij >> reshape(C.',[],1).' ans = abcdefghij Related QuestionLast letter of a wordHow to split a word to partsHow to find a first letter in a string
Best Answer