Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^2: stripping characters from a string

by ayrnieu (Beadle)
on Mar 06, 2006 at 09:41 UTC ( [id://534655]=note: print w/replies, xml ) Need Help??


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 \ ?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://534655]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-24 22:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found