File manager - Edit - G:/PleskVhosts/indiaminerals.in/tlt.INFOFIXDEVELOPERS.COM/LIBS/ParseHtml.cs
Back
using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; using System.Web; namespace WebApp.LIBS { public partial class ParseHtml { public static string parsetext(string text, bool allow) { //Create a StringBuilder object from the string intput //parameter StringBuilder sb = new StringBuilder(text); //Replace all double white spaces with a single white space //and sb.Replace(" ", " "); //Check if HTML tags are not allowed if (!allow) { //Convert the brackets into HTML equivalents sb.Replace("<", "<"); sb.Replace(">", ">"); //Convert the double quote sb.Replace("\"", """); } //Create a StringReader from the processed string of //the StringBuilder StringReader sr = new StringReader(sb.ToString()); StringWriter sw = new StringWriter(); //Loop while next character exists while (sr.Peek() > -1) { //Read a line from the string and store it to a temp //variable string temp = sr.ReadLine(); //write the string with the HTML break tag //Note here write method writes to a Internal StringBuilder //object created automatically sw.Write(temp + "<br>"); } //Return the final processed text return sw.GetStringBuilder().ToString(); } } }
| ver. 1.4 |
Github
|
.
| PHP 7.3.33 | Generation time: 0.08 |
proxy
|
phpinfo
|
Settings