using System.Collections.Generic;
using System.Text;
namespace MediaBrowser.Common.Extensions
{
///
/// Extension methods for the class.
///
public static class StringBuilderExtensions
{
///
/// Concatenates and appends the members of a collection in single quotes using the specified delimiter.
///
/// The string builder.
/// The character delimiter.
/// The collection of strings to concatenate.
/// The updated string builder.
public static StringBuilder AppendJoinInSingleQuotes(this StringBuilder builder, char delimiter, IReadOnlyList values)
{
var len = values.Count;
for (var i = 0; i < len; i++)
{
builder.Append('\'')
.Append(values[i])
.Append('\'')
.Append(delimiter);
}
// remove last ,
builder.Length--;
return builder;
}
}
}