Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: what is the function should I need to use for trim white spaces ?

by explorer (Chaplain)
on Jan 11, 2006 at 19:32 UTC ( [id://522542]=note: print w/replies, xml ) Need Help??


in reply to what is the function should I need to use for trim white spaces ?

Yes, you can use functions:
$value=" kkkk.123 "; for ( $i=0; $i<length($value); $i++ ) { if ( substr($value,$i,1) eq " " ) { substr($value,$i,1) = ""; redo; } else { last; } } for ( $i=length($value)-1; $i>0; $i-- ) { if ( substr($value,$i,1) eq " " ) { $value = substr($value,0,$i); } }
but you will like to use the s/// operator, true? :-)
  • Comment on Re: what is the function should I need to use for trim white spaces ?
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://522542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 02:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found