LPAD

Sintassi

LPAD(str, len, padstr)

Spiegazione

Restituisce la stringa str dopo aver inserito a sinistra la stringa padstr fino al raggiungimento di un numero di caratteri pari a len. Se str è più lunga di len, il valore restituito è abbreviato a len caratteri.

Esempi

MariaDB [(none)]> SELECT LPAD('salve',10,'.');
+----------------------+
| LPAD('salve',10,'.') |
+----------------------+
| .....salve           |
+----------------------+
1 row in set (0.00 sec)

MariaDB [(none)]> SELECT LPAD('salve',2,'.');
+---------------------+
| LPAD('salve',2,'.') |
+---------------------+
| sa                  |
+---------------------+
1 row in set (0.00 sec)

Vedi anche

  • rpad() ; Restituisce la stringa, allungata a destra con un'altra stringa della lunghezza specificata

Commenti

Sto caricando i commenti......
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.