19 lines
357 B
C#
19 lines
357 B
C#
|
using System;
|
|||
|
|
|||
|
namespace SearchBox.Utilities
|
|||
|
{
|
|||
|
public static class StringPlus
|
|||
|
{
|
|||
|
public static string ReplaceMultiple(this string str, char[] find, char[] replace)
|
|||
|
{
|
|||
|
for (int i = 0; i < find.Length; i++) {
|
|||
|
str = str.Replace(
|
|||
|
find[i],
|
|||
|
i < replace.Length ? replace[i] : replace[replace.Length - 1]
|
|||
|
);
|
|||
|
}
|
|||
|
return str;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|