\leaders
是你的朋友吗?
\documentclass{article}
\usepackage{color}
\makeatother
\newcommand\myTitle[1]{%
\par\noindent{\large\bfseries\mbox{#1\ }\textcolor[gray]{.8}{\leaders\vrule height 1ex\hfill}\par}}
\begin{document}
\myTitle{Some Title}
\myTitle{Some Other Title}
\end{document}