using System;
//using System.Text;
namespace SCard
{
/// <summary>
/// CleanString 的摘要说明。
/// </summary>
public sealed class CleanString
{
public static string htmlInputText( string inputString )//HTML过滤输入字符串
{
if ((inputString != null) && (inputString != String.Empty ))
{
inputString = inputString.Trim();
inputString = inputString.Replace("'",""");
inputString = inputString.Replace("<","<");
inputString = inputString.Replace(">",">");
inputString = inputString.Replace(" "," ");
inputString = inputString.Replace("\n","<br>");
return inputString.ToString();
}
return "";
}
public static string htmlOutputText( string inputString )//HTML还原字符串
{
if ((inputString != null) && (inputString != String.Empty ))
{
inputString = inputString.Trim();
inputString = inputString.Replace(""","'");
inputString = inputString.Replace("<","<");
inputString = inputString.Replace(">",">");
inputString = inputString.Replace(" "," ");
inputString = inputString.Replace("<br>","\n");
return inputString.ToString();
}
return "";
}
}
}
//using System.Text;
namespace SCard
{
/// <summary>
/// CleanString 的摘要说明。
/// </summary>
public sealed class CleanString
{
public static string htmlInputText( string inputString )//HTML过滤输入字符串
{
if ((inputString != null) && (inputString != String.Empty ))
{
inputString = inputString.Trim();
inputString = inputString.Replace("'",""");
inputString = inputString.Replace("<","<");
inputString = inputString.Replace(">",">");
inputString = inputString.Replace(" "," ");
inputString = inputString.Replace("\n","<br>");
return inputString.ToString();
}
return "";
}
public static string htmlOutputText( string inputString )//HTML还原字符串
{
if ((inputString != null) && (inputString != String.Empty ))
{
inputString = inputString.Trim();
inputString = inputString.Replace(""","'");
inputString = inputString.Replace("<","<");
inputString = inputString.Replace(">",">");
inputString = inputString.Replace(" "," ");
inputString = inputString.Replace("<br>","\n");
return inputString.ToString();
}
return "";
}
}
}