perf: cache regex in StripWhitespace
Use existing Whitespace Lazy<Regex> instead of creating new Regex each call. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -345,7 +345,7 @@ public static partial class StringExtensions
|
||||
/// </summary>
|
||||
/// <param name="txt"></param>
|
||||
/// <returns></returns>
|
||||
public static string StripWhitespace(this string txt) => Regex.Replace(txt, @"\s", string.Empty);
|
||||
public static string StripWhitespace(this string txt) => Whitespace.Value.Replace(txt, string.Empty);
|
||||
|
||||
/// <summary>
|
||||
/// Strips carrage returns and line feeds from the specified text.
|
||||
|
||||
Reference in New Issue
Block a user