Forum Discussion
kavithams - Small edit in your code and it worked fine. Strange but you have to use a different variable inside a function.
Before
<#function replaceVal msg> <#assign msg = msg?replace('following ','FOLLOWING') /> <#return msg /> </#function>
After
<#function replaceVal msg> <#assign repleacedText = msg?replace('following ','FOLLOWING') /> <#return repleacedText /> </#function>
Also, you if you want to ignore case-sensitive, you can pass another parameter 'i" as mentioned by PerBonomi
E.g
<#assign repleacedText = msg?replace('following ','FOLLOWING', 'i') />
Related Content
- 4 years ago
- 13 years agoInactive User
- 6 years ago