The \if primitive tests purely on the basis of character code, with only the need to watch out for active characters:
\long\def\example#1{% \if\noexpand#1;% ... and so on. Alternatively, you could use \pdfstrcmp to do a string-based comparison, and therefore not worry about only grabbing a single token.
\usepackage{pdftexcmds} % For \pdf@strcmp \makeatletter \long\def\example#1{% \ifnum\pdf@strcmp{\unexpanded{#1}}{;}=\z@ % Gives 0 when TRUE ... (See the recent how to create switch structure comparing strings in latexhow to create switch structure comparing strings in latex for more on \pdfstrcmp.)