Truncate given string

string:truncate(STRING string
, INT max: 85
, STRING ellipsis: "…") : STRING

string:truncate('this is nice',5)
#=> "this…"

string:truncate('this is nice',5, '')
#=> "this "

string:truncate('this is nice',10, '[removed]')    
#=> "t[removed]"

Copyright ©2013-2022 SunSed®. All rights reserved.