System.StringBuilderExtensions.AppendIf C# (CSharp) Метод

AppendIf() публичный статический Метод

Appends an Object to this string builder if the condition is true.
public static AppendIf ( this builder, bool condition, object value ) : StringBuilder
builder this
condition bool Indicates whether we append this object to the end of this StringBuilder
value object The value to append
Результат StringBuilder
        public static StringBuilder AppendIf(this StringBuilder builder, bool condition, object value)
        {
            if (condition)
                builder.Append(value);
            return builder;
        }
StringBuilderExtensions