Move const variable outside forloop

This commit is contained in:
ivandroly 2015-07-11 01:10:19 +00:00
parent 9a267c496a
commit 17a64014c3

View File

@ -43,12 +43,12 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats
public override string ToText(Subtitle subtitle, string title) public override string ToText(Subtitle subtitle, string title)
{ {
var sb = new StringBuilder();
const string format = "{0}{1}{2}"; const string format = "{0}{1}{2}";
const string tags = "{Bottom}{Open Caption}{Center}{White}{Font Arial GVP Bold}";
var sb = new StringBuilder();
sb.AppendLine("00:00:00:00{BC}{W2710}"); sb.AppendLine("00:00:00:00{BC}{W2710}");
foreach (Paragraph p in subtitle.Paragraphs) foreach (Paragraph p in subtitle.Paragraphs)
{ {
const string tags = "{Bottom}{Open Caption}{Center}{White}{Font Arial GVP Bold}";
string text = HtmlUtil.RemoveHtmlTags(p.Text, true); string text = HtmlUtil.RemoveHtmlTags(p.Text, true);
text = text.Replace(Environment.NewLine, "{N}"); text = text.Replace(Environment.NewLine, "{N}");
sb.AppendLine(string.Format(format, EncodeTimeCode(p.StartTime), tags, text)); sb.AppendLine(string.Format(format, EncodeTimeCode(p.StartTime), tags, text));