length


Description:

public int length { get; }

Returns the length of the given string in bytes.

Example: Get the byte-length:

public static int main (string[] args) {
string str = "Ἀρχιμήδης";
int letters = str.char_count ();
int bytes = str.length;

// Output: ``letters: 9, bytes: 19``
print ("letters: %d, bytes: %d\n", letters, bytes);
return 0;
}

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