Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to remove white spaces from string in c#

using System.Linq;

// ...

string example = "   Hi there!    ";
string trimmed = String.Concat(example.Where(c => !Char.IsWhiteSpace(c)));
// Result: "Hithere!"
Source by kodify.net #
 
PREVIOUS NEXT
Tagged: #remove #white #spaces #string
ADD COMMENT
Topic
Name
1+4 =