Add remove unneeded space fix - thx Boulder08 :)

Fix #4493
This commit is contained in:
Nikolaj Olsson 2020-11-15 21:03:54 +01:00
parent 8c941f84b1
commit df442d9f64

View File

@ -2169,6 +2169,16 @@ namespace Nikse.SubtitleEdit.Core
text = text.Replace(" ,", ",");
}
while (text.Contains(" 's "))
{
text = text.Replace(" 's ", "'s ");
}
while (text.Contains(" 's" + Environment.NewLine))
{
text = text.Replace(" 's" + Environment.NewLine, "'s" + Environment.NewLine);
}
if (text.EndsWith(" .", StringComparison.Ordinal))
{
text = text.Remove(text.Length - 2, 1);