truncateExpect 

The string ignores truncation until the ending character (endStringChar). If the expected length is reached, return the truncated string until after the ending character.
Parameters
| Name | Type | Required | Default |
|---|---|---|---|
str | string | ● | – |
expectLength | number | ● | – |
endStringChar![]() named | string | – | '.' |

named parameters are passed as named parameters in Dart and keyword arguments in Python.
Returns
string
Examples
javascript
truncateExpect('hello. this is test string.', 10, '.'); // Returns 'hello. this is test string.'
truncateExpect('hello-this-is-test-string-bye', 14, '-'); // Returns 'hello-this-is-'dart
truncateExpect('hello. this is test string.', 10, endStringChar: '.'); // Returns 'hello. this is test string.'
truncateExpect('hello-this-is-test-string-bye', 14, endStringChar: '-'); // Returns 'hello-this-is-'python
truncateExpect('hello. this is test string.', 10, '.') # Returns 'hello. this is test string.'
truncateExpect('hello-this-is-test-string-bye', 14, '-') # Returns 'hello-this-is-'