cJustify

Centers a string in a given field length by adding spaces to either side.

cJustify(string, length) → returns string

Argument Reference

string string
Required

The string that is to be centered

length numeric
Required

The length of the field in which the string should be centered

Examples
Sample code invoking the cJustify function

<cfset jstring = cJustify("ColdFusion", 35)> 
 <cfdump var="#jstring#" />   

Signup for cfbreak to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.

Fork me on GitHub