#!/usr/bin/perl -- use strict; use warnings; use Data::Dump qw/ dd /; my $msg = NoMiddleSpaces( ' i t s a r a c e ' ); dd( $msg ); sub NoMiddleSpaces { my( $start, $middle, $end ) = $_[0] =~ m{^(\s*)(.*?)(\s*$)}is; $middle =~ s{\s+}{}g; return "$start$middle$end"; } __END__ " itsarace "
In reply to Re^2: Removing the space in a string
by Anonymous Monk
in thread Removing the space in a string
by prashanthiyer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |