Help for this page

Select Code to Download


  1. or download this
    my $string = "word1 word2 word3";
    $string = join ' ', map { ucfirst } split /\s+/, $string;
    
  2. or download this
    use strict;
    use warnings;
    
    my $string = "word1 word2 word3";
    $string =~ s/(\w+)(?=\W|$)/ucfirst $1/eg;