Hi all
sorry for this probably very basic question but i'd appreciate a little
help!
I need to remove spaces from user input at the start and end of the string.
I can use:
$varname=3D~s/^\s+(.*)/$1/; # remove leading spaces
to remove spaces at the start of the string and this works OK but my
attempt to remove
spaces from the end does not work:
$varname=3D~s/(.*)\s+$/$1/; # remove trailing spaces?
(presunmably this is because (.*) matches everything includng the spaces?)
Can anyone suggest the best way to clean up the user input. - I wish to
allow spaces
in the middle of the string and remove all whitespace from the start and
end.
Thanks very much
Bill Stennett
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]