sharp-chat/SharpChat/SharpUtil.cs

10 lines
328 B
C#

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