erase


Description:

public unowned StringBuilder erase (ssize_t pos = 0, ssize_t len = -1)

Removes len bytes from a StringBuilder, starting at position pos.

The rest of the StringBuilder is shifted down to fill the gap.

Example: Erase:

public static int main (string[] args) {
// Output: ``hello, world!``
StringBuilder builder = new StringBuilder ("hello, economy around the world!\n");
// "hello, economy around the world!\n"
// ^----------------->
// 7 19
builder.erase (7, 19);
print (builder.str);
return 0;
}

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

Parameters:

this

a StringBuilder

pos

the position of the content to remove

len

the number of bytes to remove, or -1 to remove all following bytes

Returns:

this