GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   perl question (https://gfy.com/showthread.php?t=435740)

Zester 02-23-2005 07:17 AM

perl question
 
I know how to get rid of a white space at the end of the string: that's either chop or chomp

but how do you get rid of a white space at the beginning of a string?

mortenb 02-23-2005 07:21 AM

http://www.somacon.com/blog/page14.php

darksoul 02-23-2005 07:23 AM

chomp by default removes new lines from the end of the string.
anyway this is what you're looking for:

$x =~ s/^\s+//g; for beginning
$x =~ s/\s+$//g; for ending.

Zester 02-23-2005 07:29 AM

thanks----


All times are GMT -7. The time now is 05:52 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123