Dear all, I would like to detect whether a string contains an alphabetical letter. A simple way of solving this problem is writing a function such as. But is there any better, more concise and faster way? Can one use, say, regular expressions and if so how?
thanks, Pat.
function flag=detect_alphabet(mystring) referenceSet={'a','b','c','d',...,'z'}; flag=false; for ii=1:length(mystring) if ismember(mystring(ii),referenceSet) flag=true; break end end
Best Answer