How to remove content within round brackets in a string in Velocity?
We want to have FirstName LastName (Abbr.) displayed as FirstName LastName.
I'm trying with regex but is not working, I'm new in velocity, and I would like kindly ask what's wrong in the script:
I tried this version:
#set ($string = ${lead.Account_Owner__c})
#set ($var1 = $string.replace("/\(\w+\)/", ""))
This is the Account Owner Without Abbreviation: $var1
This is not removing anything.
-----
This the other version I tried:
#set ($string = ${lead.Account_Owner__c})
#set ($var1 = $string.replace(/\(\w+\)/, ""))
This is the Account Owner Without Abbreviation: $var1
This script gives an error.
Thanks in advance!
Cheers,
Cristina
#velocity my token#velocity script #velocity error #velocity scripting