Easy way to remove formatting (e.g. linebreaks)

I have defined the following shortcut for some text

\newcommand{\sometext}{text\\text\\text}


Now I would like to use this in some other place but with the linebreaks removed. So is there an easy way to do it (e.g. something like "\remove_linebreaks{\sometext}")?

-

This will change \\ into a space:
\newcommand{\removelinebreaks}[1]{%

\\  has an optional star and an optional argument. Something like \def\\{\@ifstar {\@gobbleopt}{\@gobbleopt}}\providecommand*\@gobbleopt[1][]{} would handle these too. –  Schweinebacke Nov 23 '11 at 13:56