mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-10-28 06:52:35 +01:00
Merge pull request #788 from ivandrofly/charOverString
Use char replace over strings
This commit is contained in:
commit
98e86b2383
@ -2671,12 +2671,12 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
Paragraph p = Subtitle.Paragraphs[i];
|
||||
string text = p.Text;
|
||||
string oldText = text;
|
||||
text = text.Replace("Ý", "İ");
|
||||
text = text.Replace("Ð", "Ğ");
|
||||
text = text.Replace("Þ", "Ş");
|
||||
text = text.Replace("ý", "ı");
|
||||
text = text.Replace("ð", "ğ");
|
||||
text = text.Replace("þ", "ş");
|
||||
text = text.Replace('Ý', 'İ');
|
||||
text = text.Replace('Ð', 'Ğ');
|
||||
text = text.Replace('Þ', 'Ş');
|
||||
text = text.Replace('ý', 'ı');
|
||||
text = text.Replace('ð', 'ğ');
|
||||
text = text.Replace('þ', 'ş');
|
||||
if (oldText != text && AllowFix(p, fixAction))
|
||||
{
|
||||
p.Text = text;
|
||||
|
@ -125,7 +125,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
{
|
||||
try
|
||||
{
|
||||
name = name.Replace("_", "-");
|
||||
name = name.Replace('_', '-');
|
||||
if (name.Length > 5)
|
||||
name = name.Substring(0, 5);
|
||||
var ci = new CultureInfo(name);
|
||||
@ -163,7 +163,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
{
|
||||
try
|
||||
{
|
||||
name = name.Replace("_", "-");
|
||||
name = name.Replace('_', '-');
|
||||
if (name.Length > 5)
|
||||
name = name.Substring(0, 5);
|
||||
var ci = new CultureInfo(name);
|
||||
@ -355,7 +355,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
{
|
||||
text = text.Replace("fi", "fi"); // fb01
|
||||
text = text.Replace("fl", "fl"); // fb02
|
||||
text = text.Replace("ν", "v"); // NOTE: first 'v' is a special unicode character!!!!
|
||||
text = text.Replace('ν', 'v'); // NOTE: first 'v' is a special unicode character!!!!
|
||||
}
|
||||
|
||||
text = ReplaceWordsBeforeLineFixes(text);
|
||||
|
Loading…
Reference in New Issue
Block a user