mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Store duplicated string in const variable
This commit is contained in:
parent
9a91dc09f6
commit
5b8fe998d7
@ -966,15 +966,16 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
const string p = @" ¡¿,.!?:;()[]{}+-$£""”“#&%…—♪";
|
||||||
foreach (string name in _namesEtcMultiWordList)
|
foreach (string name in _namesEtcMultiWordList)
|
||||||
{
|
{
|
||||||
int start = tempLine.FastIndexOf(name);
|
int start = tempLine.FastIndexOf(name);
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
{
|
{
|
||||||
if (start == 0 || (Environment.NewLine + @" ¡¿,.!?:;()[]{}+-$£""”“#&%…—♪").Contains(tempLine[start - 1]))
|
if (start == 0 || (Environment.NewLine + p).Contains(tempLine[start - 1]))
|
||||||
{
|
{
|
||||||
int end = start + name.Length;
|
int end = start + name.Length;
|
||||||
if (end >= tempLine.Length || (Environment.NewLine + @" ¡¿,.!?:;()[]{}+-$£""”“#&%…—♪").Contains(tempLine[end]))
|
if (end >= tempLine.Length || (Environment.NewLine + p).Contains(tempLine[end]))
|
||||||
tempLine = tempLine.Remove(start, name.Length);
|
tempLine = tempLine.Remove(start, name.Length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user