truncate_middle
Description:
[ Version ( since = "2.78" ) ]
[ CCode ( cname = "g_utf8_truncate_middle" ) ]
public string truncate_middle (size_t truncate_length)
[ CCode ( cname = "g_utf8_truncate_middle" ) ]
public string truncate_middle (size_t truncate_length)
Cuts off the middle of the string, preserving half of truncate_length
characters at the beginning and half at the end.
If string
is already short enough, this returns a copy of string
. If truncate_length
is `0`, an empty
string is returned.
Parameters:
truncate_length |
the new size of |
string |
a nul-terminated UTF-8 encoded string |
Returns:
a newly-allocated copy of |