velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trad-ex <>
Subject How can I trimming $string ?
Date Fri, 19 May 2006 05:28:43 GMT
Hi all,

I have a question how to trim string smarter way.
My code is:

#macro( returnString $arg ) something


  #set( $somVal = "#returnString( $arg )" )
When I checked the contents of $someVal, it contained two leading space-
charachters and trailing \r\n.
So I should use trim() before I use $someVal value.
For instances,

 #if( $someVal.trim() == "SomeThing" )
My question is:
1. Is there smarter way to trim the white-spaces ?
2. What's wrong with my codes ?

Best Regards,

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message