diff --git a/src/Forms/MultipleReplace.cs b/src/Forms/MultipleReplace.cs index c90a1df56..8bbf8e640 100644 --- a/src/Forms/MultipleReplace.cs +++ b/src/Forms/MultipleReplace.cs @@ -193,11 +193,7 @@ namespace Nikse.SubtitleEdit.Forms int index = newText.IndexOf(findWhat, StringComparison.OrdinalIgnoreCase); while (index >= 0) { - if (index < newText.Length) - newText = newText.Substring(0, index) + replaceWith + newText.Substring(index + findWhat.Length); - else - newText = newText.Substring(0, index) + replaceWith; - + newText = newText.Substring(0, index) + replaceWith + newText.Remove(0, index + findWhat.Length); hit = true; index = newText.IndexOf(findWhat, index + replaceWith.Length, StringComparison.OrdinalIgnoreCase); }