regexThu, 02 Mar 2023

C# How to remove all white space and space symbols from the beginning or end of a string?

Regex.Replace(str, "\\s+", "");

Questions about programming?Chat with your personal AI assistant