in reply to Re: stripping characters from a string
in thread stripping characters from a string

I'd prefer this, actually:

for ($string) { tr/ '/_/d; print }

Replies are listed 'Best First'.
Re^3: stripping characters from a string
by Samy_rio (Vicar) on Mar 06, 2006 at 09:59 UTC

    ayrnieu, OP's need

    Good_Ol_Time

    but your output shows

    Good_O l_Time

    As per perlfunc - Perl builtin functions tutorial.

    y///
    The transliteration operator. Same as tr///.

    Updated: ayrnieu updated his answer without proper information.

    Regards,
    Velusamy R.


    eval"print uc\"\\c$_\""for split'','j)@,/6%@0%2,`e@3!-9v2)/@|6%,53!-9@2~j';

      ah, "and remove any '". I know what y/// is, I just don't know why anyone would use it. Why do you have a \ ?