Merge pull request #788 from ivandrofly/charOverString

Use char replace over strings
This commit is contained in:
Nikolaj Olsson 2015-05-28 09:35:33 +02:00
commit 98e86b2383
2 changed files with 9 additions and 9 deletions

View File

@ -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;

View File

@ -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);