Using StringBind in BoxLang #69
Replies: 2 comments 2 replies
-
This is great mail-merge-like function to have built into the language. (Is there anything like this available for CFML at CFLib.org?) I wrote a UDF with a similar functionality. In addition to the optional parameters with fallback default values, it also accepted a "lang" argument that check to determine if translated text from a database existed. It would also format phone numbers and dates using the allowed locales. |
Beta Was this translation helpful? Give feedback.
-
You can leverage either For example, I have client that has event website and they use It took me a little while, but I found my prior art. I shared a basic "TokenReplace" UDF back in 2020 that performs similar functionality. (NOTE: This version doesn't leverage a fallback value in the original string.) Here's a direct link to the UDF gist w/demo: NOTE: I also just noticed on TryCF that this UDF may not work correctly in CF10 or Lucee5, but it works with every other more-modern CFML versions (including TryCF's BoxLang). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Using StringBind in BoxLang
An example of the StringBind function.
https://www.raymondcamden.com/2025/08/18/using-stringbind-in-boxlang
Beta Was this translation helpful? Give feedback.
All reactions