I would like to create slides where some sections of texts are replaced by underscores (or an underline of equivalent length) in the student handouts.
I have seen this solution but it only "blanks" the text. What I would like to do is replace it with underscores.
I have also seen this solution based on a customized \hideit command but I do not know how to replace the mbox by the appropriate number of underscores _ characters.
ECM taken from the second link:
\documentclass[handout]{beamer}
\begin{document}
\begin{frame}{Test}
\begin{itemize}
\item Example of itemize:
\mode<handout>{%
\item Some text _____________________
}%
\mode<beamer>{%
\item Some text to be replaced by underscores
}%
\item This is visible in both handout and presentation.
\end{itemize}
\end{frame}
\end{document}

censorpackage at, for example, http://tex.stackexchange.com/questions/125840/create-fill-in-the-blank-version-of-a-document-with-ability-to-toggle-blanks-on or this, http://tex.stackexchange.com/questions/165248/an-underline-with-texts-one-both-ends-of-a-line/165302#165302 – Steven B. Segletes Sep 01 '16 at 18:16