Gimp.utf8_strtrim

@accepts(unicode, int)
@returns(unicode)
def utf8_strtrim(str, max_chars):
    # Python wrapper for gimp_utf8_strtrim()
  

Creates a (possibly trimmed) copy of str. The string is cut if it exceeds max_chars characters or on the first newline. The fact that the string was trimmed is indicated by appending an ellipsis.

str

an UTF-8 encoded string (or None)

max_chars

the maximum number of characters before the string get trimmed

Returns