Centers a string in a field length.
String, center-justified by adding spaces before or after the input parameter. If length is less than the length of the input parameter string, the string is returned unchanged.
Display and formatting functions, String functions
Cjustify(string, length)
Parameter |
Description |
|---|---|
string |
A string or a variable that contains one. May be empty. If it is a variable that is defined as a number, the function processes it as a string. |
length |
A positive integer or a variable that contains one. Length of field.Can be coded as:
|
<CFOUTPUT>
<cfset OriginalString="ColdFusion"/>
<B>Original String (quoted):</B> "#OriginalString#"<BR>
<B>Center-justified String (quoted):</B> "#CJustify("ColdFusion", 20)#"
</CFOUTPUT>
Sign in to your account