sharp-chat/SharpChat/Utility.cs

10 lines
326 B
C#

namespace SharpChat {
public static class Utility {
public static string Sanitise(string? body) {
if(string.IsNullOrEmpty(body))
return string.Empty;
return body.Replace("<", "&lt;").Replace(">", "&gt;").Replace("\n", " <br/> ").Replace("\t", " ");
}
}
}