Known value that was previously returned by this function, if none, pass empty string.
New value that may have to be trimmed down.
Number of bytes the value may be in size.
Optional
filterFunction: FilterFunctionFunction to call on the string before assessing the length.
Utility function to trim down a string, based on byteLimit and given a safe start position. It supports insertion anywhere in the string, so "foo" to "fobaro" if limit is 4 will result in "fobo", not "foba". Basically emulating the native maxlength by reconstructing where the insertion occurred.