Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

how to remove all whitespace from a string in c#

  using System.Linq;

  ... 

  string source = "abc    	 def
789";
  string result = string.Concat(source.Where(c => !char.IsWhiteSpace(c)));

  Console.WriteLine(result);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #whitespace #string
ADD COMMENT
Topic
Name
8+4 =