This commit is contained in:
nsnail 2022-12-09 11:24:01 +08:00
parent 97acd3ea56
commit 1ea481e749
2 changed files with 13 additions and 3 deletions

View File

@ -1,3 +1,3 @@
do.exe trim-utf8-bom
do.exe remove-whitespace
do.exe convert-lf
dot rbom -w
dot trim -w
dot tolf -w

View File

@ -522,6 +522,16 @@ public static class StringExtensions
.ToLower(CultureInfo.CurrentCulture);
}
/// <summary>
/// 纯文本字符串转html
/// </summary>
/// <param name="me"></param>
/// <returns></returns>
public static string Text2Html(this string me)
{
return me.Replace(" ", "&nbsp;").Replace("\r\n", "<br />").Replace("\r", "<br />").Replace("\n", "<br />");
}
/// <summary>
/// 蛇形命名