remove

% list all unique letters present in mytext

unique(mytext)

&()+,-./0123456789:;<=>?ABCDEFGHIJKLMNOPQRSTUVWYZabcdefghijklmnopqrstuvwxyz|©–—‘’“”

% remove newline character

strrep(mytext,sprintf('\n'),'')

% remove special characters, keep only letters A..Z and a..z

mytext = char(mytext); % in case of string, convert to char

mytext(~ismember(mytext, ['A':'Z', 'a':'z'] )) = '';

unique(mytext)

ABCDEFGHIJKLMNOPQRSTUVWYZabcdefghijklmnopqrstuvwxyz