static public string FormatString(string formerlyString,int subNum)
{
try
{
if(formerlyString != null)
{
formerlyString = formerlyString.Trim().Replace("<br />","┣");
formerlyString = formerlyString.Replace("<br>","┫");
formerlyString = formerlyString.Replace("&","㊣");
formerlyString = formerlyString.Replace("/"","卐");
Regex a = new Regex(@"(/<.[^/<]*/>)");
Regex b = new Regex(@"(/<//[^/<]*/>)");
Regex c = new Regex(@"(/{.[^/{]*/})");
formerlyString = a.Replace(formerlyString,"");
formerlyString = b.Replace(formerlyString,"");
formerlyString = c.Replace(formerlyString,"");
formerlyString = formerlyString.Replace(" ","├");
formerlyString = formerlyString.Replace("<","【");
formerlyString = formerlyString.Replace(">","】");
if(subNum < formerlyString.Length && subNum >= 0 && subNum.ToString().Length < 10)
{
formerlyString = formerlyString.Substring(0,subNum);
formerlyString = formerlyString + "...";
}
else
{
formerlyString = formerlyString.Substring(0,formerlyString.Length);
}
formerlyString = formerlyString.Replace("┣"," ");
formerlyString = formerlyString.Replace("㊣","&");
formerlyString = formerlyString.Replace("卐",""");
formerlyString = formerlyString.Replace("┫","<br>");
formerlyString = formerlyString.Replace("├"," ");
formerlyString = formerlyString.Replace("【","<");
formerlyString = formerlyString.Replace("】",">");
}
else
{
formerlyString = "";
}
}
catch(Exception ex)
{
formerlyString = "";
}
return formerlyString;
}
{
try
{
if(formerlyString != null)
{
formerlyString = formerlyString.Trim().Replace("<br />","┣");
formerlyString = formerlyString.Replace("<br>","┫");
formerlyString = formerlyString.Replace("&","㊣");
formerlyString = formerlyString.Replace("/"","卐");
Regex a = new Regex(@"(/<.[^/<]*/>)");
Regex b = new Regex(@"(/<//[^/<]*/>)");
Regex c = new Regex(@"(/{.[^/{]*/})");
formerlyString = a.Replace(formerlyString,"");
formerlyString = b.Replace(formerlyString,"");
formerlyString = c.Replace(formerlyString,"");
formerlyString = formerlyString.Replace(" ","├");
formerlyString = formerlyString.Replace("<","【");
formerlyString = formerlyString.Replace(">","】");
if(subNum < formerlyString.Length && subNum >= 0 && subNum.ToString().Length < 10)
{
formerlyString = formerlyString.Substring(0,subNum);
formerlyString = formerlyString + "...";
}
else
{
formerlyString = formerlyString.Substring(0,formerlyString.Length);
}
formerlyString = formerlyString.Replace("┣"," ");
formerlyString = formerlyString.Replace("㊣","&");
formerlyString = formerlyString.Replace("卐",""");
formerlyString = formerlyString.Replace("┫","<br>");
formerlyString = formerlyString.Replace("├"," ");
formerlyString = formerlyString.Replace("【","<");
formerlyString = formerlyString.Replace("】",">");
}
else
{
formerlyString = "";
}
}
catch(Exception ex)
{
formerlyString = "";
}
return formerlyString;
}