If the field value we receive is “998529 Other security services nowhere else classified,” but we only want the first token up to the space (998529 ), we can use Advanced Printing’s built-in “substring” and “index_of” functions. Sample code: <#if item.custcol_in_hsn_code?has_content> <#assign hsn_code = item.custcol_in_hsn_code?substring(0, item.custcol_in_hsn_code?index_of(” “))> <#else> … Continue reading Substring till a blank space in advanced HTML/PDF template
Tag: substring in freemarker
Get substring from a string using string index
This code snippet will assist you in obtaining a substring by utilising the built-in functionality of freemarker.