Merge remote-tracking branch 'origin/v10/dev' into v11/dev

# Conflicts:
#	src/Umbraco.Core/Routing/UmbracoRequestPaths.cs
This commit is contained in:
Bjarke Berg
2023-03-29 10:29:44 +02:00
22 changed files with 3872 additions and 49 deletions

View File

@@ -1040,14 +1040,15 @@ public static class StringExtensions
throw new ArgumentNullException(nameof(text));
}
var pos = text.IndexOf(search, StringComparison.InvariantCulture);
ReadOnlySpan<char> spanText = text.AsSpan();
var pos = spanText.IndexOf(search, StringComparison.InvariantCulture);
if (pos < 0)
{
return text;
}
return text.Substring(0, pos) + replace + text.Substring(pos + search.Length);
return string.Concat(spanText[..pos], replace.AsSpan(), spanText[(pos + search.Length)..]);
}
/// <summary>