わかりました、皆さんが提案したすべてのことを試しましたが、まだうまくいきません. 理由はわかりませんが、出力がキックされないこともあれば、正しくない出力が出力されることもあります。私は何を間違っていますか。
InPutBox = Input.Text;
int x = 1;
var lines = Input.Text.Split(new string[] { Environment.NewLine },StringSplitOptions.None);
for (var index = 0; index < lines.Length; index++)
{
var line = lines[index];
do
{
x++;
System.Console.WriteLine("'{0}'", InPutBox);
bool test1 = InPutBox.StartsWith("11600");
bool test2 = InPutBox.EndsWith("(");
if (test1 && test2)
{
int first = InPutBox.IndexOf("11600");
int last = InPutBox.LastIndexOf("(");
InPutBox = InPutBox.Substring(first, last - first);
}
}
while (x < 50);
System.Console.WriteLine("'{0}'", line);
if ((line.StartsWith("11600") && line.EndsWith("(")))
{
MessageBox.Show("These are errors in line" + index + ": " + line);
break;
}
}