Trims a string to a given length and makes sure that all words up to $maxlen are preserved, without exceeding $maxlen.
Warning: Currently, this function uses a regular ASCII-Whitespace to do the separation test. If you are using ' ' to create spaces, this function will fail.
Example: $string = "This is a simple test"; echo cApiStrTrimAfterWord($string, 15);
This would output "This is a", since this function respects word boundaries and doesn't operate beyond the limit given by $maxlen.
Deprecated: [2015-05-21] use cString::trimAfterWord
Copyright: four for business AG <www.4fb.de>
Author: Timo Hummel
Located at includes/functions.api.string.php
||The string to operate on|
||The maximum number of characters|
||The resulting string|