Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re^3: lcfirst and ucfirst not working

by davido (Archbishop)
on Aug 27, 2012 at 17:38 UTC ( #990030=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    print "Please enter your name:\n";
    chomp( $name = <> );
    $x = ucfirst $name;
    print $x;
  2. or download this
    # The \u metacharacter acts only upon the first character.
    # No need for substr.
    $x = "\u$name";
  3. or download this
    # Assuming Perl 5.14+
    $x = $name =~ s/^(.)/\u$1/r;
  4. or download this
    $x = $name;
    $x =~ s/^(.)/\u$1/;

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2015-11-30 06:06 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (758 votes), past polls