Performance improvement for ReplaceFirst function (#13018)
* Some benchmarks for replacefirst & span method
(cherry picked from commit e550a4ce3a)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
888173ac5b
commit
eee6207f19
@@ -326,6 +326,14 @@ public class StringExtensionsTests
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
[TestCase("test to test", "test", "release", "release to test")]
|
||||
[TestCase("nothing to do", "test", "release", "nothing to do")]
|
||||
public void ReplaceFirst(string input, string search, string replacement, string expected)
|
||||
{
|
||||
var output = input.ReplaceFirst(search, replacement);
|
||||
Assert.AreEqual(expected, output);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsFullPath()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user