The following code works as I would like it to: Given the state of the boolean, certain content is to be printed or not. If it's not printed, then I run the risk of creating extraneous whitespace. So, I use \ignorespaces to avoid this.
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\bool_new:N \g__ace_show_content_bool
\bool_gset_true:N \g__ace_show_content_bool
\NewDocumentCommand{\mycommand}{ m }
{
\bool_if:NTF \g__ace_show_content_bool
{
#1
}
{
\ignorespaces
}
}
\NewDocumentCommand{\togglestate}{ }
{
\bool_if:NTF \g__ace_show_content_bool
{ \bool_gset_false:N \g__ace_show_content_bool }
{ \bool_gset_true:N \g__ace_show_content_bool }
}
\ExplSyntaxOff
\pagestyle{empty}
\begin{document}
\textbf{Line 1:} Testing \mycommand{This} \mycommand{is} \mycommand{my} \mycommand{trial} \mycommand{run.} Testing
\togglestate
\textbf{Line 2:} Testing \mycommand{This} \mycommand{is} \mycommand{my} \mycommand{trial} \mycommand{run.} Testing
\togglestate
\textbf{Line 3:} Testing \mycommand{This} \mycommand{is} \mycommand{my} \mycommand{trial} \mycommand{run.} Testing
\end{document}
It seems that LaTeX3 already implements a large portion of what plain TeX does. So, it seems to me that plain TeX code like \ignorespaces doesn't really belong in a LaTeX3 context. But I can't find equivalents of \unskip and \ignorespaces in the LaTeX3 documentation.
Am I missing something? Is there another work-around? Or has this not been implemented yet?


\unskipand\ignorespacesbelong to the realm of typesetting and currentexpl3code doesn't treat it. There's nothing bad in using them, if you prefer not using\tex_unskip:Dor\tex_ignorespaces:D. – egreg Feb 22 at 15:42:Dwere verboten except for kernal development purposes. – A.Ellett Feb 22 at 15:45