Trimming characters off a token in an email script
I am using an email script token and am trying to remove the last three chars from the token.
The problem I think I am having is that the code I am using to strip the three chars assumes the value of the token is a string but I assume it is not (its type however is set to string).
If I am correct with that assumption how do I convert the value to a string, or is there an alternate way to remove the three chars?
Here is the code I am using, I get an error when I try and send the email and it references the substring.
When I hardcode a value in it works fine
#set ($string = ${lead.cRCURL})
#set ($stringLength = $string.length() - 3)
#set ($string = $string.substring(0,$stringLength))
$string
Any help would be greatly appreciated.
Thanks,
Jason