Closed SamSandq closed 7 months ago
Fixed in commit: https://github.com/frang75/nappgui_src/commit/845c4c01ca282abbe6751ed51cb6a28b1860076f
The trim
and add_empty
are diferent operations. Added a new function parameter.
https://nappgui.com/en/core/string.html#f52
Nice solution, even if not backwards compatible.
Yes it's correct. I am considering introducing a deprecation system. But, for the moment, it will bring more complications than benefits. In general, the public API is quite stable.
The function
str_splits
does not work with empty splits. This works:it prints
However, this does not:
It prints:
But it should handle the two consecutive separators correctly, and print:
(i.e., the 3rd piece is the empty string).
The trim flag does not affect this behaviour, except that it's actually worse: for a string
"1|2| |4"
it seems to trim first, and then decide to ignore the empty 3rd piece, and print the size as 3, and the pieces as the incorrect example above.