in reply to Re: Insert Space between names
in thread Insert Space between names

Note that that puts a space in front of John.


DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^3: Insert Space between names
by Errto (Vicar) on Nov 21, 2005 at 02:27 UTC
    Depends on whether the string consists only of the name (or more precisely, starts with the name) or not. If it does then there's no extra space.

      Following the stealth update that is true. When I commented, the code was:

      my $string = "JohnDoe"; $string =~ s/([A-Z])/ $1/g; print $string;

      DWIM is Perl's answer to Gödel