Difference between revisions of "PADR()"

From Lianjapedia
Jump to: navigation, search
m (Text replace - "Recital" to "Lianja")
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to pad out a string to a specified length
 
Function to pad out a string to a specified length
 
  
 
==Syntax==
 
==Syntax==
 
PADR(<expC1>, <expN> [, <expC2>])
 
PADR(<expC1>, <expN> [, <expC2>])
 
  
 
==See Also==
 
==See Also==
 
[[CENTER()]], [[LPAD()]], [[PADC()]], [[PADL()]], [[RPAD()]], [[SET STRESCAPE]], [[STR()]], [[STR_PAD()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]]
 
[[CENTER()]], [[LPAD()]], [[PADC()]], [[PADL()]], [[RPAD()]], [[SET STRESCAPE]], [[STR()]], [[STR_PAD()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]]
 
  
 
==Description==
 
==Description==
 
The PADR() function left justifies a character string <expC1> and pads out the right of the string, to a total length of <expN> characters.  PADR() returns the new string.  If <expC2> is not specified, <expC1> will be padded with blanks, otherwise, the string will be padded with the character specified by <expC2>.  If the string being processed is longer than the specified total length, it is truncated.  This function is the same as RPAD() and is included for language compatibility.
 
The PADR() function left justifies a character string <expC1> and pads out the right of the string, to a total length of <expN> characters.  PADR() returns the new string.  If <expC2> is not specified, <expC1> will be padded with blanks, otherwise, the string will be padded with the character specified by <expC2>.  If the string being processed is longer than the specified total length, it is truncated.  This function is the same as RPAD() and is included for language compatibility.
 
  
 
==Example==
 
==Example==
Line 20: Line 16:
 
abcXXX
 
abcXXX
 
</code>
 
</code>
 
  
 
==Products==
 
==Products==

Revision as of 10:12, 12 December 2012

Purpose

Function to pad out a string to a specified length

Syntax

PADR(<expC1>, <expN> [, <expC2>])

See Also

CENTER(), LPAD(), PADC(), PADL(), RPAD(), SET STRESCAPE, STR(), STR_PAD(), STRTRAN(), STRZERO(), STUFF()

Description

The PADR() function left justifies a character string <expC1> and pads out the right of the string, to a total length of <expN> characters. PADR() returns the new string. If <expC2> is not specified, <expC1> will be padded with blanks, otherwise, the string will be padded with the character specified by <expC2>. If the string being processed is longer than the specified total length, it is truncated. This function is the same as RPAD() and is included for language compatibility.

Example

? rpad("abc",6,"X") 
abcXXX

Products

Lianja Server, Lianja