[Purdue-pm] challenge snippet

Rick Westerman westerman at purdue.edu
Sat Aug 15 18:19:36 PDT 2015


Isn’t that just a simple regex?  Here is a two liner.

$t =~ s/^\s+//; 
$t =~ s/\s+$//;

--
Rick Westerman
westerman at purdue.edu




> On Aug 15, 2015, at 9:03 PM, Mark Senn <mark at purdue.edu> wrote:
> 
> I haven't noticed any replies to the challenge problem,
> so, in case people don't plan to work on it here is something
> easier.
> 
> In Perl 5 and Perl 6, given the scalar $t, show how to delete
> all ASCII space characters at the beginning and end of that string.
> Only use statements built in to the version of Perl you are using.
> 
> -mark
> _______________________________________________
> Purdue-pm mailing list
> Purdue-pm at pm.org
> http://mail.pm.org/mailman/listinfo/purdue-pm



More information about the Purdue-pm mailing list