nfill


Description:

public static string nfill (size_t length, char fill_char)

Creates a new string length bytes long filled with fill_char.

The returned string should be freed when no longer needed.

Example: Fill a string with n chars:

public static int main (string[] args) {
// Output: ``zzzzzzzzzz``
string str = string.nfill (10, 'z');
print ("%s\n", str);
return 0;
}

valac --pkg glib-2.0 string.nfill.vala

Parameters:

length

the length of the new string

fill_char

the byte to fill the string with

Returns:

a newly-allocated string filled the fill_char