truncate


Description:

public unowned StringBuilder truncate (size_t len = 0)

Cuts off the end of the GString, leaving the first len bytes.

Example: Cuts off the end of the builder:

public static int main (string[] args) {
// Output: ``hello, world!``
StringBuilder builder = new StringBuilder ("hello, world!\n I love you!");
builder.truncate (14);
print (builder.str);
return 0;
}

valac --pkg glib-2.0 GLib.StringBuilder.truncate.vala

Parameters:

this

a StringBuilder

len

the new size of this

Returns:

this