-
public unowned
string? str (string needle)
-
public unowned
string? rstr (string needle)
Searches the string haystack for the last occurrence of the string needle.
-
public unowned
string? rstr_len (ssize_t haystack_len, string needle)
Searches the string haystack for the last occurrence of the string needle, limiting the length of the search
to haystack_len.
-
public bool has_prefix (
string prefix)
Looks whether the string str begins with prefix.
-
public bool has_suffix (
string suffix)
Looks whether the string str ends with suffix.
-
public
string printf (...)
-
public
string vprintf (va_list args)
-
public int scanf (...)
-
public
string concat (string string2, ...)
-
public
string escape (string exceptions)
Escapes the special characters '\b', '\f', '\n', '\r', '\t', '\' and '"' in the string source by inserting
a '\' before them.
-
public
string compress ()
Replaces all escaped characters with their one byte equivalent.
-
public
string[] split (string delimiter, int max_tokens = 0)
Splits a string into a maximum of max_tokens pieces, using the given delimiter.
-
public
string[] split_set (string delimiters, int max_tokens = 0)
Splits string into a number of tokens not containing any of the characters in delimiter.
-
public unowned
string next_char ()
-
public unichar get_char ()
-
public unichar get_char_validated (ssize_t max_len = -1)
-
public unowned
string offset (long offset)
-
public long pointer_to_offset (
string pos)
-
public unowned
string prev_char ()
-
public long len (ssize_t max = -1)
-
public unowned
string chr (ssize_t len, unichar c)
-
public unowned
string rchr (ssize_t len, unichar c)
-
public
string reverse (ssize_t len = -1)
-
public bool validate (ssize_t max_len = -1, out char* end = null)
-
public
string normalize (ssize_t len = -1, NormalizeMode mode = NormalizeMode.DEFAULT)
-
public
string up (ssize_t len = -1)
-
public
string down (ssize_t len = -1)
-
public
string casefold (ssize_t len = -1)
-
public int collate (
string str2)
-
public
string collate_key (ssize_t len = -1)
-
public
string collate_key_for_filename (ssize_t len = -1)
-
public
string locale_to_utf8 (ssize_t len, out size_t bytes_read, out size_t bytes_written, out Error error = null)
-
public unowned
string _chomp ()
Removes trailing whitespace from a string.
-
public
string chomp ()
-
public unowned
string _chug ()
Removes leading whitespace from a string, by moving the rest of the characters forward.
-
public
string chug ()
-
public unowned
string _strip ()
Removes leading and trailing whitespace from a string.
-
public
string strip ()
-
public unowned
string _delimit (string delimiters, char new_delimiter)
Converts any delimiter characters in string to new_delimiter.
-
public
string delimit (string delimiters, char new_delimiter)
-
public uint hash ()
-
public int to_int ()
-
public long to_long (out
string endptr = null, int _base = 0)
-
public double to_double (out
string endptr = null)
-
public ulong to_ulong (out
string endptr = null, int _base = 0)
-
public int64 to_int64 (out
string endptr = null, int _base = 0)
Converts a string to a gint64 value.
-
public uint64 to_uint64 (out
string endptr = null, int _base = 0)
Converts a string to a guint64 value.
-
public bool to_bool ()
-
public size_t size ()
-
public int ascii_casecmp (
string s2)
Compare two strings, ignoring the case of ASCII characters.
-
public int ascii_ncasecmp (
string s2, size_t n)
Compare s1 and s2, ignoring the case of ASCII characters and any characters after the first n in each
string.
-
public void canon (
string valid_chars, char substitutor)
For each character in string, if the character is not in valid_chars, replaces the character with
substitutor.
-
public
string dup ()
-
public
string ndup (size_t n)
Duplicates the first n bytes of a string, returning a newly-allocated buffer n + 1 bytes long which will
always be nul-terminated.
-
public
string substring (long offset, long len = -1)
-
public
string slice (long start, long end)
-
public
string splice (long start, long end, string? str = null)
-
public bool contains (
string needle)
-
public
string replace (string old, string replacement)
-
public char[] to_utf8 ()
-
public unowned
string to_string ()