using System;
using System.Text;
using System.Web;
namespace Bas
{
/// <summary>
/// Summary description for BasFun.
/// </summary>
public class BasFun
{
public BasFun()
{
}
public string TextToHtml(string chr)
{
if (chr == null)
{
return "";
}
chr = chr.Replace(" ", " ");
chr = chr.Replace("<", "<");
chr = chr.Replace(">", ">");
chr = chr.Replace("\n", "<br>");
chr = chr.Replace("\t", " ");
chr = chr.Replace("'","'");
return chr;
}
public string HtmlToText(string chr)
{
if (chr == null)
{
return "";
}
chr = chr.Replace(" ", " ");
chr = chr.Replace("<", "<");
chr = chr.Replace(">", ">");
chr = chr.Replace("<br>", "\n");
chr = chr.Replace(" ", "\t");
chr = chr.Replace("'","'");
return chr;
}
protected string Output(object inputString)
{
if (inputString == null)
return string.Empty;
StringBuilder strBuilder = new StringBuilder();
string str1 = HttpContext.Current.Server.HtmlEncode(inputString.ToString());
strBuilder.Insert(0, str1);
strBuilder.Replace(((char)32).ToString(), " ");
strBuilder.Replace(((char)9).ToString(), " ");
strBuilder.Replace(((char)34).ToString(), """);
strBuilder.Replace(((char)39).ToString(), "'");
strBuilder.Replace(((char)13).ToString(), " ");
strBuilder.Replace(((char)10).ToString() + ((char)10).ToString(), "</P><P>");
strBuilder.Replace(((char)10).ToString(), "<BR>");
return strBuilder.ToString();
}
}
}