sharp-chat/SharpChat/Utility.cs

11 lines
326 B
C#
Raw Normal View History

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", " ");
}
}
}