3 ms·
Most likely answer: The built-in trim isn't Unicode aware or has buggy behavior when dealing with Unicode.
by jandrese 10y ago
Most likely answer: The built-in trim isn't Unicode aware or has buggy behavior when dealing with Unicode.
- Someone1234 10y agoAssuming they're still using ASP.net 4+, it is very unicode aware/safe. I don't know why a developer would reinvent Trim() but I do know it isn't a .Net limitation.
- gbrayut 10y agoThis code was written 5 years ago, and back then the trim function was different.
- deleted 10y ago[deleted]
- gnud 10y ago.NET builtin trim lets you specify which 'char' values to trim [1]. .NET is notoriously tied to UTF-16 (a char is 16 bit), and you have to handle surrogate pairs very carefully, but I can't really imagine that being any better with the built-in System.Text.RegularExpressions.Regex 1: https://msdn.microsoft.com/en-us/library/d4tt83f9(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/d4tt83f9(v=vs.110)....