I found a ticket in our issue tracker that one of customers report a bug that one texts is incomplete! We have a text conversion program from one legacy system(IBM AS400) to a modern one. I tracked it and found an unknown behavior on my code!!
First see this:
As you see, there is two char before first space (char32), but when i remove Trim()
,the result is:
Yes, Trim()
removes char160 from beginning! What happened that Trim()
works more than need?
Note: both pictures are captured in same test state.
160 is a NBSP (Non-breaking space) and according to the documentation, Trim
will remove all the whitespace. 160 is classified in Unicode as whitespace.
You might want to call Trim(' ')
instead.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With