Difference between revisions of "LPAD()"

From Lianjapedia
Jump to: navigation, search
m (Text replace - "Recital" to "Lianja")
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to pad out a character string to a defined length from the left
 
Function to pad out a character string to a defined length from the left
 
  
 
==Syntax==
 
==Syntax==
 
LPAD(<expC1>, <expN> [, <expC2>])
 
LPAD(<expC1>, <expN> [, <expC2>])
 
  
 
==See Also==
 
==See Also==
 
[[CENTER()]], [[PADC()]], [[PADL()]], [[PADR()]], [[RPAD()]], [[SET STRESCAPE]], [[STR()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]], [[SUBSTR()]]
 
[[CENTER()]], [[PADC()]], [[PADL()]], [[PADR()]], [[RPAD()]], [[SET STRESCAPE]], [[STR()]], [[STRTRAN()]], [[STRZERO()]], [[STUFF()]], [[SUBSTR()]]
 
  
 
==Description==
 
==Description==
Line 15: Line 12:
  
 
The LPAD() function is synonymous with the PADL() function.  
 
The LPAD() function is synonymous with the PADL() function.  
 
  
 
==Example==
 
==Example==
Line 23: Line 19:
 
</code>
 
</code>
  
 
==Products==
 
Lianja Database Server, Lianja Mirage Server, Lianja Terminal Developer
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:String Data]]
 
 
[[Category:String Data Functions]]
 
[[Category:String Data Functions]]

Latest revision as of 06:40, 4 February 2013

Purpose

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

Syntax

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

See Also

CENTER(), PADC(), PADL(), PADR(), RPAD(), SET STRESCAPE, STR(), STRTRAN(), STRZERO(), STUFF(), SUBSTR()

Description

The LPAD() function right justifies a character string <expC1> and pads out the left 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 LPAD() function is useful for creating fixed length character strings by padding out the string with blanks. If the string being processed is longer than the specified total length, the string is truncated.

The LPAD() function is synonymous with the PADL() function.

Example

? lpad("abc",6,"d")
dddabc