LPAD(str,len,padstr) : LPAD : String Functions MySQL TUTORIALS


MySQL TUTORIALS » String Functions » LPAD »

 

LPAD(str,len,padstr)


If str is longer than len, the return value is shortened to len characters.

mysql>
mysql> SELECT LPAD('ABC',4,'??');
+--------------------+
| LPAD('ABC',4,'??') |
+--------------------+
| ?ABC               |
+--------------------+
row in set (0.00 sec)

mysql>
mysql> SELECT LPAD('ABC',1,'??');
+--------------------+
| LPAD('ABC',1,'??') |
+--------------------+
| A                  |
+--------------------+
row in set (0.00 sec)

mysql>
mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo String Functions
» LPAD