mirror of
https://github.com/ICDSystems/ICD.Common.Utils.git
synced 2026-04-13 20:47:24 +00:00
feat: Adding string extension method for removing all instances of a given string, fixes unexpected use of Remove characters method
This commit is contained in:
parent
6b37db3530
commit
42cc8c2cfc
2 changed files with 32 additions and 1 deletions
|
|
@ -58,6 +58,13 @@ namespace ICD.Common.Utils.Tests.Extensions
|
|||
Assert.AreEqual(expected, value.RemoveWhitespace());
|
||||
}
|
||||
|
||||
[TestCase("1234567890", "12345", "67890")]
|
||||
[TestCase("foobarfoobar", "bar", "foofoo")]
|
||||
public void RemoveStringTest(string value, string other, string expected)
|
||||
{
|
||||
Assert.AreEqual(expected, value.Remove(other));
|
||||
}
|
||||
|
||||
[TestCase("1234567890", new[] {'2', '6'}, "13457890")]
|
||||
[TestCase("912529434324", new[] {'-', '(', ')', '.', '+'}, "912529434324")]
|
||||
public void RemoveCharactersTest(string value, IEnumerable<char> characters, string expected)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue