Änderung
- Es werden keine Leerzeilen bei mehrfachem Zeilenumbruch eingefügt.
This commit is contained in:
parent
51efb5f7ac
commit
28c505f306
Binary file not shown.
@ -146,7 +146,6 @@ namespace Eugen.ESystem
|
|||||||
|
|
||||||
if (spacePos - 1 > 0)
|
if (spacePos - 1 > 0)
|
||||||
{
|
{
|
||||||
//temp = text.Remove(spacePos - 1);
|
|
||||||
temp = text.Remove(spacePos);
|
temp = text.Remove(spacePos);
|
||||||
if (temp.EndsWith(" "))
|
if (temp.EndsWith(" "))
|
||||||
{
|
{
|
||||||
@ -154,11 +153,13 @@ namespace Eugen.ESystem
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//temp = text.Remove(spacePos - 1);
|
|
||||||
if (temp.EndsWith("\n") || temp.EndsWith("\r"))
|
if (temp.EndsWith("\n") || temp.EndsWith("\r"))
|
||||||
|
{
|
||||||
|
while (temp.EndsWith("\n") || temp.EndsWith("\r"))
|
||||||
{
|
{
|
||||||
temp = temp.Remove(temp.Length - 1);// Ein schon enthaltenes '\n' oder '\r' am Ende des temporären Strings muss entfernt werden
|
temp = temp.Remove(temp.Length - 1);// Ein schon enthaltenes '\n' oder '\r' am Ende des temporären Strings muss entfernt werden
|
||||||
}
|
}
|
||||||
|
}
|
||||||
text = text.Remove(0, spacePos);
|
text = text.Remove(0, spacePos);
|
||||||
result = String.Concat(result, temp, "\r\n");
|
result = String.Concat(result, temp, "\r\n");
|
||||||
pos = 0;
|
pos = 0;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9,3 +9,4 @@ H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedL
|
|||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedLineLength\obj\Debug\FixedLineLength.csproj.CoreCompileInputs.cache
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedLineLength\obj\Debug\FixedLineLength.csproj.CoreCompileInputs.cache
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedLineLength\obj\Debug\heffixll.dll
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedLineLength\obj\Debug\heffixll.dll
|
||||||
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedLineLength\obj\Debug\heffixll.pdb
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedLineLength\obj\Debug\heffixll.pdb
|
||||||
|
H:\Programmieren\Git-WorkRepository\VisualStudio\_DLL\FixedLineLength.git\FixedLineLength\obj\Debug\FixedLineLength.csproj.AssemblyReference.cache
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
8
Test_FixedLineLength/Form1.Designer.cs
generated
8
Test_FixedLineLength/Form1.Designer.cs
generated
@ -44,7 +44,7 @@ namespace Test_FixedLineLength
|
|||||||
// button1
|
// button1
|
||||||
//
|
//
|
||||||
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.button1.Location = new System.Drawing.Point(12, 523);
|
this.button1.Location = new System.Drawing.Point(12, 483);
|
||||||
this.button1.Name = "button1";
|
this.button1.Name = "button1";
|
||||||
this.button1.Size = new System.Drawing.Size(776, 23);
|
this.button1.Size = new System.Drawing.Size(776, 23);
|
||||||
this.button1.TabIndex = 0;
|
this.button1.TabIndex = 0;
|
||||||
@ -73,7 +73,7 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
this.groupBoxProgramInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.groupBoxProgramInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo);
|
this.groupBoxProgramInfo.Controls.Add(this.labelProgramInfo);
|
||||||
this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 552);
|
this.groupBoxProgramInfo.Location = new System.Drawing.Point(12, 512);
|
||||||
this.groupBoxProgramInfo.Name = "groupBoxProgramInfo";
|
this.groupBoxProgramInfo.Name = "groupBoxProgramInfo";
|
||||||
this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66);
|
this.groupBoxProgramInfo.Size = new System.Drawing.Size(385, 66);
|
||||||
this.groupBoxProgramInfo.TabIndex = 9;
|
this.groupBoxProgramInfo.TabIndex = 9;
|
||||||
@ -94,7 +94,7 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
this.groupBoxDLLInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
this.groupBoxDLLInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||||
this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo);
|
this.groupBoxDLLInfo.Controls.Add(this.labelDLLInfo);
|
||||||
this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 552);
|
this.groupBoxDLLInfo.Location = new System.Drawing.Point(403, 512);
|
||||||
this.groupBoxDLLInfo.Name = "groupBoxDLLInfo";
|
this.groupBoxDLLInfo.Name = "groupBoxDLLInfo";
|
||||||
this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66);
|
this.groupBoxDLLInfo.Size = new System.Drawing.Size(385, 66);
|
||||||
this.groupBoxDLLInfo.TabIndex = 10;
|
this.groupBoxDLLInfo.TabIndex = 10;
|
||||||
@ -115,7 +115,7 @@ namespace Test_FixedLineLength
|
|||||||
//
|
//
|
||||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||||
this.ClientSize = new System.Drawing.Size(800, 630);
|
this.ClientSize = new System.Drawing.Size(800, 590);
|
||||||
this.Controls.Add(this.groupBoxProgramInfo);
|
this.Controls.Add(this.groupBoxProgramInfo);
|
||||||
this.Controls.Add(this.groupBoxDLLInfo);
|
this.Controls.Add(this.groupBoxDLLInfo);
|
||||||
this.Controls.Add(this.labelResult);
|
this.Controls.Add(this.labelResult);
|
||||||
|
|||||||
@ -122,7 +122,7 @@ namespace Test_FixedLineLength
|
|||||||
|
|
||||||
private void button1_Click(object sender, EventArgs e)
|
private void button1_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
string text = "Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet.\r\nIst im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet.\r\nEs sollten auch \\ erkannt werden, damit lange Verzeichnisnamen wie z.B. C:\\das\\ist\\ein\\sehr\\sehr\\sehr\\sehr\\sehr\\langer\\Pfad\\den\\wir\\hier\\haben, getrennt werden können.";
|
string text = "Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet.\r\nIst im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet. Leerzeilen werden aber nicht berücksichtigt.\r\nEs werden auch \\ erkannt, damit lange Verzeichnisnamen wie z.B. C:\\das\\ist\\ein\\sehr\\sehr\\sehr\\sehr\\sehr\\langer\\Pfad\\den\\wir\\hier\\haben, getrennt werden können.";
|
||||||
int lineLength = 25;
|
int lineLength = 25;
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
|
|||||||
@ -120,6 +120,6 @@
|
|||||||
<data name="label1.Text" xml:space="preserve">
|
<data name="label1.Text" xml:space="preserve">
|
||||||
<value>Ursprünglicher Text:
|
<value>Ursprünglicher Text:
|
||||||
|
|
||||||
Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet. Ist im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet. Es sollten auch \ erkannt werden, damit lange Verzeichnisnamen wie z.B. C:\das\ist\ein\sehr\sehr\sehr\sehr\sehr\langer\Pfad\den\wir\hier\haben, getrennt werden können.</value>
|
Das ist ein Text, der immer nach 25 Zeichen getrennt werden soll, aber nur dann wenn das Zeichen ein Leerzeichen ist. Ist das 25. Zeichen kein Leerzeichen, dann beim letzten Leerzeichen vor der 25. Stelle trennen. Dabei werden beim Trennen keine Typografischen Regeln beachtet. Ist im Text ein Zeilenvorschub, dann wird dieser erkannt und auch im formatierten Text verwendet. Leerzeilen werden aber nicht berücksichtigt. Es werden auch \ erkannt, damit lange Verzeichnisnamen wie z.B. C:\das\ist\ein\sehr\sehr\sehr\sehr\sehr\langer\Pfad\den\wir\hier\haben, getrennt werden können.</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user