mrc logo mrc logo
  • m-Power m-Power
    What is m-Power?
    Overview Demos Build Process Case Studies Specs Pricing Trial
    m-Power Resources
    Overview How-To Videos Webinars & Podcasts White Papers Fact Sheets
  • Solutions Solutions
    What does m-Power build?
    Overview Database Front-Ends Reporting CRM Systems Business Intelligence Dashboards Mobile Apps ERP Enhancements Modernization Spreadsheets to the web MS Access to the web B2B/Web Portals Scheduling Embedded Analytics Web Forms Workflow Data Exploration Budgeting & Forecasting APIs and Web Services
    Solutions by Industry
    Overview Manufacturing Government Foodservice Software Vendors Logistics & Supply Chain Software Consultants Healthcare
  • Services Services
    Overview Training Project Consulting Staff Consulting Mentoring
  • About About
    Overview Partners Press Releases Careers Events Contact Blog
  • Support Support
    Support Home FAQ Documentation Customer Portal Enhancements Updates Roadmap Techblog
Try m-Power

m-Power Manual

Browse:

  • Home
  • Freemarker
  • String Functions within Freemarker
Back to Manual

String Functions Available within Freemarker

 

There are many String Manipulation tools available to you within Freemarker. Often times, adding these Freemarker options will save you time, give you greater flexibility as a developer, and make your applications even more robust. To add these functions, simply open m-Painter and right click on the Field you wish to modify. Select the "Application Field Properties" option. Add the String Function into the "Representation" box in the correct location. When completed, hit OK. Then be sure to save your application.

Here is a list of many common and useful String Functions available to you within Freemarker Logic.

Sub-stringing

While you can sub-string as a calculation, you can also sub-string using Freemarker. An example of its usefulness would be sub-stringing a portion of a common field.

Note: Please remember that the 1st character of your string is the 0 position. If my ${row.CITY} equals "CHICAGO", the following expressions would give these results:

Freemarker Code Result
${row.CITY?substring(1)} HICAGO
${row.CITY?substring(3)} CAGO
${row.CITY?substring(0,1)} C
${row.CITY?substring(0,3)} CHI
${row.CITY?substring(2,3)} I

Capitalize First Letter

The function ${row.FIELD?cap_first} will capitalize the first letter of your field if it is lower case. All other letters are ignored.

Un-Capitalize First Letter

This function is the exact opposite of the one listed above, and the function and is written ${row.FIELD?uncap_first}.

Capitalize

This function will capitalize the first letter in all words and un-capitalize all other letters. This function is denoted ${row.FIELD?capitalize}

For instance, a normal output of "LOS ANGELES" would output "Los Angeles" with the ?capitalize freemarker function.

Upper Case

This function will capitalize all letters within a string. It is noted as ${row.FIELD?upper_case}.

Note: If you are in a Maintenance application and trying to ensure upper case from the user, please use the "Do not Allow Lower Case" option from the Pre-format Level.

Lower Case

This function will un-capitalize all letters within a string. It is noted as ${row.FIELD?lower_case}.

HTML

This function will encode all fields for use within an HTML page. For instance, if your field contains an "&" it will be encoded to the HTML version of the ampersand "&". This guarantees that the browser will handle all fields correctly. This is the default encoding for all generated fields with m-Power. It is noted as ${row.FIELD?html}.

URL

This function will encode all fields for use within an HTML's URL. For instance, if your field contains an "#" it will be encoded to the URL version of the pound sign "%23;". This guarantees that the browser will handle all fields correctly when being passed along the URL. This is the default encoding for all fields that a user selects through the Hyperlink Wizard within m-Painter. It is noted as ${row.FIELD?url}.

Trim

The Freemarker Trim function will remove all leading and trailing spaces from a field. It is denoted: ${row.FIELD?trim}

Length

The Freemarker Length function will return the number of characters in the field. It is denoted: ${row.FIELD?length}

Replace

This is a very useful Freemarker function as it allows you to replace a certain value directly within your field. It is denoted:

${row.FIELD?replace("FINDTHISTEXT", "REPLACEWITHTHISTEXT")}

For example, if my Field value was CHICAGO, and my function looked like this:

${row.FIELD?replace("CAGO", "NA TOWN")}

My output would be "CHINA TOWN". This is just an abbreviated list showing the most common Freemarker String Functions. A full list can be found here.

Created: September 11, 2008 | Modified: April 8, 2020

Search


Browse By Category

Build Process (13)
Starting with m-Power (8)
Retrievals (10)
Reports (15)
Summaries (4)
Maintainers (17)
Graphs (8)
m-Power Data Explorer (4)
General (24)
Calculations (5)
Utilities (9)
m-Power Administration (23)
Security (11)
Freemarker (6)
m-Painter (29)
Form Validation (5)
External Objects & UDFs (12)
Deprecated Documentation (23)
Bootstrap Templates (7)

Popular Tags

SQL App Properties Getting Started Report Retrievals Administration Record Selections Advanced Dropdowns Production Security Graphing Bar Graphs mrc-Productivity Series Form Validation Graph Properties Java Calculations Prompt Screens Bootstrap Templates Retrieval Popular Admin External Objects Data Dictionary Graphs Email Parameters Build Process Freemarker DB2 Application Properties Maintainer Dates Maintainers RPG Excel Video Tomcat Performance Compiling Reports m-Painter Database Summaries

See all tags »

michaels, ross & cole, ltd. (mrc)
Privacy Settings Privacy Policy Cookie Policy Employee Intranet
© 2023 mrc. All rights reserved.
mrc (US)

2001 Midwest Road
Suite 310
Oak Brook, IL 60523
630-916-0662

mrc (UK)

Mortlake Business Centre
20 Mortlake High Street
London, SW14 8JN
+44-20-335-59566