Improve "Find names" in change casing

This commit is contained in:
Nikolaj Olsson 2017-09-23 16:21:11 +02:00
parent 926deca402
commit d739694eb8

View File

@ -142,10 +142,7 @@ namespace Nikse.SubtitleEdit.Forms
while (startIndex >= 0 && startIndex < text.Length &&
textToLower.Substring(startIndex).Contains(name.ToLower()) && name.Length > 1 && name != name.ToLower())
{
bool startOk = (startIndex == 0) || (text[startIndex - 1] == ' ') || (text[startIndex - 1] == '-') ||
(text[startIndex - 1] == '"') || (text[startIndex - 1] == '\'') || (text[startIndex - 1] == '>') ||
(Environment.NewLine.EndsWith(text[startIndex - 1].ToString(CultureInfo.InvariantCulture), StringComparison.Ordinal));
bool startOk = startIndex == 0 || "([ --'>\r\n¿¡".Contains(text[startIndex - 1]);
if (startOk)
{
int end = startIndex + name.Length;