Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Replacing Whitespace with Underscore

by jimpudar (Pilgrim)
on Apr 09, 2018 at 16:24 UTC ( [id://1212598]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ perl -wE 'my $str = "JA_PH"; $str =~ s/_/\s/; say $str'
    Unrecognized escape \s passed through at -e line 1.
    JAsPH
    $ perl -wE 'my $str = "JA_PH"; $str =~ s/_/ /; say $str'
    JA PH
    
  2. or download this
    $ perl -wE 'my $str = "Some text with  whitespace"; $str =~ s/\s /_/g;
    + say $str'
    Some text with_whitespace
    ...
    Some_text_with__whitespace
    $ perl -wE 'my $str = "Some text with  whitespace"; $str =~ s/\s+/_/g;
    + say $str'
    Some_text_with_whitespace
    

Log In?
Username:
Password:

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

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

    No recent polls found