\documentclass{article}
\usepackage{expl3}
\ExplSyntaxOn
\catcode`#=11
\str_set:Nn \l_tmpa_str {#}
\tl_analysis_show:N \l_tmpa_str
\str_set:Nn \l_tmpb_str {#}
\tl_analysis_show:N \l_tmpb_str
\ExplSyntaxOff
The above code gives
The token list \l_tmpa_str contains the tokens:
> # (the character #)
> # (the character #).
<recently read> }
l.7 \tl_analysis_show:N \l_tmpa_str
?
The token list \l_tmpb_str contains the tokens:
> # (the character #).
<recently read> }
l.9 \tl_analysis_show:N \l_tmpb_str
?
Why there are two #
in \l_tmpa_str
but only one in \l_tmpb_str
?