Strlib:str-pad

From SA-MP Wiki

Jump to: navigation, search


Description:

The function str_replace allows you to replace a string with another string in one huge string.


Image:32px-Circle-style-warning.png

Warning

This function is part of the strlib library. Click here to view its download page on the SA-MP forums.



Parameters:
(str_pad)
sSource[]The string you want to pad.
iPadLength[]The length of the new string.
iPadCharOptional character to pad the string with.

Return Values:

Padded string.


Example

new
    sString[] = "Pad me!";
 
print("'%s'", str_pad(sString, 10));
print("'%s'", str_pad(sString, 10, '@'));

Output

'Pad me!   '
'Pad me!@@@'
Personal tools