mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-05 05:27:37 +08:00
32 lines
810 B
C#
32 lines
810 B
C#
using System;
|
|
|
|
namespace AntDesign.Docs.Utils
|
|
{
|
|
public static class StringExtensions
|
|
{
|
|
public static string TrimWhiteSpace(this string str)
|
|
{
|
|
if (str == null)
|
|
{
|
|
return null;
|
|
}
|
|
char[] whiteSpace = { '\r', '\n', '\f', '\t', '\v' };
|
|
return str.Trim(whiteSpace).Trim();
|
|
}
|
|
|
|
public static string FixLineBreakForWeb(this string str)
|
|
{
|
|
return str.Replace(Environment.NewLine, "<br/>");
|
|
}
|
|
|
|
public static string FixTabsForWeb(this string str)
|
|
{
|
|
return str.Replace("\t", " ");
|
|
}
|
|
|
|
public static string FixSpaceForWeb(this string str)
|
|
{
|
|
return str.Replace(" ", " ");
|
|
}
|
|
}
|
|
} |