RPAD

Stai visualizzando una vecchia versione di questo article. Visualizza la versione più recente.

Sintassi

RPAD(str, len, padstr)

Spiegazione

Restituisce la stringa str, dopo aver inserito a destra la stringa padstr fino a raggiungere una lunghezza di len caratteri. Se str è più lunga di len, il valore restituito è abbreviato a len caratteri.

Esempi

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

MariaDB [(none)]> SELECT RPAD('hello',2,'.');
+---------------------+
| RPAD('hello',2,'.') |
+---------------------+
| he                  |
+---------------------+
1 row in set (0.00 sec)

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.