replace 2 strings at a time in velocity template

61 Views Asked by At

SERIAL_NUMBER {SerialNumber} not found in iLPN/Tote {IlpnId}

I want to replace {SerialNumber} with some value and also want to replace {abcd} with some value at a time. I am able to replace either {SerialNumber} or {abcd} one at a time but not both.

how to do this using velocity template language?

1

There are 1 best solutions below

0
nischal sharma On

Here is an example of how you can replace multiple variables in a string using Velocity Template Language:

#set($SerialNumber = "1234")
#set($abcd = "xyz")
SERIAL_NUMBER $SerialNumber not found in iLPN/Tote $abcd

In the above example, $SerialNumber and $abcd are two variables that are being replaced with the values "1234" and "xyz" respectively.