has_suffix


Description:

[ Version ( since = "2.2" ) ]
public bool has_suffix (string suffix)

Looks whether the string str ends with suffix.

Example: Check whether the string ends with a suffix:

public static int main (string[] args) {
// Output: ``true``
bool res = "Would You Like a Jelly Baby".has_suffix ("Baby");
print ("%s\n", res.to_string ());

// Output: ``false``
res = "Would You Like a Jelly Baby".has_suffix ("Would");
print ("%s\n", res.to_string ());

return 0;
}

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

Parameters:

suffix

the nul-terminated suffix to look for

str

a nul-terminated string

Returns:

true if str end with suffix, false otherwise.