using System;
public static class ClipboardFusionHelper
{
public static string ProcessText(string text)
{
System.IO.StringReader sr = new System.IO.StringReader(text);
System.Text.StringBuilder sb = new System.Text.StringBuilder();
string line;
int count = 0;
int failSafe = 100000; //Set Failsafe to 100,000 so that we'll break after that many tries
line = sr.ReadLine();
while (line != null)
{
sb.AppendLine(line.Trim());
line = sr.ReadLine();
count += 1; //increment count and check if we're in an infinite loop
if (count == failSafe)
return "Failed.\nFail Safe At: " + failSafe.ToString() + "\nCopy Fewer Lines";
}
return sb.ToString();
}
}