mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 03:02:35 +01:00
fix zero length string replace
This commit is contained in:
parent
7d3ecd76ef
commit
2b7ee2292c
@ -670,7 +670,7 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
}
|
||||
newFirstWord = newFirstWord.Trim();
|
||||
|
||||
string result;
|
||||
string result = null;
|
||||
|
||||
// If we can find it...
|
||||
if (originalText.IndexOf(firstWord, StringComparison.Ordinal) >= 0)
|
||||
@ -678,7 +678,7 @@ namespace Nikse.SubtitleEdit.Core.Common
|
||||
// Replace it
|
||||
result = ReplaceFirstOccurrence(originalText, firstWord, newFirstWord);
|
||||
}
|
||||
else
|
||||
else if (newFirstWord.Length > 0)
|
||||
{
|
||||
// Just remove whatever prefix we need to remove
|
||||
var prefix = firstWord.Replace(newFirstWord, "");
|
||||
|
Loading…
Reference in New Issue
Block a user