From 3a1a71d1c18ba21e56f3f5f65670ac85c5dd74ac Mon Sep 17 00:00:00 2001 From: nsnail Date: Fri, 9 Dec 2022 16:55:52 +0800 Subject: [PATCH] --- push2nuget.ps1 | 2 +- src/Extensions/StringExtensions.cs | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/push2nuget.ps1 b/push2nuget.ps1 index 3e911c8..13df55a 100644 --- a/push2nuget.ps1 +++ b/push2nuget.ps1 @@ -10,7 +10,7 @@ if ($apikey -eq $null -or $apikey -eq "") } rm -r ./build/nupkgs -dotnet build -c Release ./src/NSExt.sln +dotnet build -c Release $files = Get-ChildItem -Path ./build/nupkgs/ -Filter *.nupkg foreach($file in $files) { diff --git a/src/Extensions/StringExtensions.cs b/src/Extensions/StringExtensions.cs index fdb38bf..c0ef106 100644 --- a/src/Extensions/StringExtensions.cs +++ b/src/Extensions/StringExtensions.cs @@ -518,16 +518,6 @@ public static class StringExtensions .ToLower(CultureInfo.CurrentCulture); } - /// - /// 纯文本字符串转html - /// - /// - /// - public static string Text2Html(this string me) - { - return me.Replace(" ", " ").Replace("\r\n", "
").Replace("\r", "
").Replace("\n", "
"); - } - /// /// 蛇形命名 @@ -553,6 +543,16 @@ public static class StringExtensions return me.Substring(startIndex, length); } + /// + /// 纯文本字符串转html + /// + /// + /// + public static string Text2Html(this string me) + { + return $"
{me}
"; + } + /// /// 将连续多个空格替换成一个空格 ///