Difference between revisions of "RPAD()"

From Lianjapedia
Jump to: navigation, search
m (Text replace - "Recital" to "Lianja")
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to pad out a character string to a defined length from the right
 
Function to pad out a character string to a defined length from the right
 
  
 
==Syntax==
 
==Syntax==
 
RPAD(<expC1>,<expN> [, <expC2>])  
 
RPAD(<expC1>,<expN> [, <expC2>])  
 
  
 
==See Also==
 
==See Also==
 
[[CENTER()]], [[LPAD()]], [[PADC()]], [[PADL()]], [[PADR()]], [[SET STRESCAPE]], [[STR()]], [[STR_PAD()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]]
 
[[CENTER()]], [[LPAD()]], [[PADC()]], [[PADL()]], [[PADR()]], [[SET STRESCAPE]], [[STR()]], [[STR_PAD()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]]
 
  
 
==Description==
 
==Description==
 
The RPAD() function left-justifies a character string <expC1> and pads out the right of the string, to a total length of <expN> characters, with blank spaces.  The optional <expC2> may be used to pad <expC1> with a character string instead of blank spaces.  The RPAD() function is useful for creating fixed length character strings by padding them out with blanks.  If the string being processed is longer than the specified total length, it is truncated.  The RPAD() function is synonymous with the PADR() function.
 
The RPAD() function left-justifies a character string <expC1> and pads out the right of the string, to a total length of <expN> characters, with blank spaces.  The optional <expC2> may be used to pad <expC1> with a character string instead of blank spaces.  The RPAD() function is useful for creating fixed length character strings by padding them out with blanks.  If the string being processed is longer than the specified total length, it is truncated.  The RPAD() function is synonymous with the PADR() function.
 
  
 
==Example==
 
==Example==
Line 20: Line 16:
 
abcddd
 
abcddd
 
</code>
 
</code>
 
  
 
==Products==
 
==Products==

Revision as of 10:26, 12 December 2012

Purpose

Function to pad out a character string to a defined length from the right

Syntax

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

See Also

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

Description

The RPAD() function left-justifies a character string <expC1> and pads out the right of the string, to a total length of <expN> characters, with blank spaces. The optional <expC2> may be used to pad <expC1> with a character string instead of blank spaces. The RPAD() function is useful for creating fixed length character strings by padding them out with blanks. If the string being processed is longer than the specified total length, it is truncated. The RPAD() function is synonymous with the PADR() function.

Example

? rpad("abc",6,"d")
abcddd

Products

Lianja Server, Lianja