📜  c# 从字符串中删除空格 - C# 代码示例

📅  最后修改于: 2022-03-11 14:49:19.195000             🧑  作者: Mango

代码示例4
using System.Linq;

// ...

string example = "   Hi there!    ";
string trimmed = String.Concat(example.Where(c => !Char.IsWhiteSpace(c)));
// Result: "Hithere!"