Click here to Skip to main content
15,886,806 members
Articles / General Programming / Performance

Fastest method to remove all whitespace from Strings in .NET

Rate me:
Please Sign up or sign in to vote.
4.88/5 (44 votes)
30 Jul 2015CPOL16 min read 214.3K   663   48  
There are countless ways to trim all whitespace from a string, but which one is faster?

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer CODAX Sistemas
Brazil Brazil
I've learned (self-taught) computer programming at 11 years-old on a MSX computer (a Hot-Bit from Sharp) and have since made a profession out of my love for coding software. I've been very fortunate to work on projects spawning almost the entire field of computer programming, from low-level embedded systems, serial communication protocols, socket-based communication and PLC (Programmable Logic Controller) programming to high-level ASP.NET/MVC, WinForms, WPF, JavaScript frameworks, Microsoft Azure and many other technologies. I've got lots of experience developing in C#, Pascal/Delphi, C/C++, JavaScript, VB/VB.NET and Lua but have programmed in almost all languages known to man Smile | :)

Currently I'm the CTO and principal software architect/developer of CODAX Sistemas, a Brazilian startup company offering the first and best fully cloud-based Time and Attendance and Access Control system in Brazil.

I'm also a Judo black belt under the world-renowned sensei George K. Mehdi and a Brazilian Jiu-jitsu brown belt under master Alvaro Mansor of the Soul Fighters BJJ academy.

Comments and Discussions