Adobe ColdFusion 8

RJustify

Description

Right justifies characters of a string.

Returns

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

Category

Display and formatting functions, String functions

Function syntax

RJustify(string, length)

See also

CJustify, LJustify

Parameters

Parameter

Description

string

A string enclosed in quotation marks, or a variable that contains one.

length

A positive integer or a variable that contains one. Length of field in which to justify string.

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>
<p>Enter a string. It will be right justified within the sample field

<form action = "rjustify.cfm">
<p><input type = "Text" value = "<cfoutput>#jString#</cfoutput>"
    size = 35 name = "justifyString">

<p><input type = "Submit" name = ""> <input type = "reset">
</form>