rJustify

Description

Right justifies characters of a string.

Categories

Related

Syntax

RJustify(string, length)

Attributes

AttributeDescriptionRequiredDefault
lengthA positive integer or a variable that contains one. Length of field in which to justify string.
stringA string enclosed in quotation marks, or a variable that contains one.

Returns

A copy of a string, right-justified in the specified field length.

Example

<!--- This example shows how to use RJustify ---> 
<cfparam name = "jstring" default = ""> 
 
<cfif IsDefined("FORM.justifyString")> 
    <cfset jstring = rjustify(FORM.justifyString, 35)> 
</cfif> 
<html> 
<head> 
<title>RJustify Example</title> 
</head> 
<body> 
<h3>RJustify Function</h3> 
Enter a string. It will be right justified within the sample field 
 
<form action = "rjustify.cfm"> 
<input type = "Text" value = "<cfoutput>#jString#</cfoutput>" 
    size = 35 name = "justifyString"> 
 
<input type = "Submit" name = ""> <input type = "reset"> 
</form>