using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace EVCB_OCPP.WSServer.Helper; public static class StringBuilderExtention { private readonly static char[] m_CrCf; static StringBuilderExtention() { m_CrCf = "\r\n".ToArray(); } /// /// Appends in the format with CrCf as suffix. /// /// The builder. /// The format. /// The arg. public static void AppendFormatWithCrCf(this StringBuilder builder, string format, object arg) { builder.AppendFormat(format, arg); builder.Append(m_CrCf); } /// /// Appends in the format with CrCf as suffix. /// /// The builder. /// The format. /// The args. public static void AppendFormatWithCrCf(this StringBuilder builder, string format, params object[] args) { builder.AppendFormat(format, args); builder.Append(m_CrCf); } /// /// Appends with CrCf as suffix. /// /// The builder. /// The content. public static void AppendWithCrCf(this StringBuilder builder, string content) { builder.Append(content); builder.Append(m_CrCf); } /// /// Appends with CrCf as suffix. /// /// The builder. public static void AppendWithCrCf(this StringBuilder builder) { builder.Append(m_CrCf); } }