Lpad () function usage:
The lpad function fills the string on the left with some specific characters. The syntax format is as follows:
Lpad (string, n, [pad_string])
String: but a character or Parameter
N: the length of the character, which is the number of returned strings. If the number is shorter than the length of the original string, the lpad function splits the string into n characters from left to right;
Pad_string: it is an optional parameter. This string is to be pasted to the left of the string. If this parameter is not written, the lpad function will paste a space on the left of the string.
For example:
Lpad ('tech ', 7); will return 'tech'
Lpad ('tech ', 2); will return 'te'
Lpad ('tech ', 8, '0'); will return 'technical tech'
Lpad ('tech on the net', 15, 'z'); will return 'tech on the net'
Lpad ('tech on the net', 16, 'z'); returns 'ztech on the net'
---------------------------------------------------------
Rpad () function usage:
The rpad function fills the string on the right with some specific characters. The syntax format is as follows:
Rpad (string, n, [pad_string])
String: but a character or Parameter
N: the length of the character, which is the number of returned strings. If the number is shorter than the length of the original string, the lpad function splits the string into n characters from left to right;
Pad_string: it is an optional parameter. This string is to be pasted to the right of the string. If this parameter is not written, the lpad function will paste a space on the right of the string.
For example:
Rpad ('tech ', 7); will return 'tech'
Rpad ('tech ', 2); will return 'te'
Rpad ('tech ', 8, '0'); 'tech0000' will be returned'
Rpad ('tech on the net', 15, 'z'); will return 'tech on the net'
Rpad ('tech on the net', 16, 'z'); will return 'tech on the netz'
Progress in crawling