Hi all
I need method to trim from begin, end and all internal spaces ( like trimmed + internal ) but leave special characters ( like \n or \t ) just unlike simplified.
Hi all
I need method to trim from begin, end and all internal spaces ( like trimmed + internal ) but leave special characters ( like \n or \t ) just unlike simplified.
This should work:
Qt Code:
To copy to clipboard, switch view to plain text mode
An alternative is to encode special characters as some entities, then do simplifying and then decode the entities back.
Yeah...
I was thinking that there is any method beside regular expressions
but thanks for recipe
I'm pretty sure simplified() and trimmed() use regexps as well
Bookmarks