src/Shared/EntityFramework/Core/Common/Utils/StringUtil.cs
// <summary>
// Converts an enumeration of values to a delimited string list.
// </summary>
// <typeparam name="T"> Type of elements to convert. </typeparam>
// <param name="values"> Values. If null, returns empty string. </param>
// <param name="converter"> Converter. If null, uses default invariant culture converter. </param>
// <param name="delimiter"> Delimiter. If null, uses default (', ') </param>
// <returns> Delimited list of values in string. </returns>
Converts an enumeration of values to a delimited string list.
Converts an enumeration of values to a delimited string list .
internal static string BuildDelimitedList<T>(IEnumerable<T> values, ToStringConverter<T> converter, string delimiter)
        {
            if (null == values)
            {
                return String.Empty;
            }
            if (null == converter)
            {
                converter = InvariantConvertToString;
            }
            if (null == delimiter)
            {
                delimiter = s_defaultDelimiter;
            }
            var sb = new StringBuilder();
            var first = true;
            foreach (var value in values)
            {
                if (first)
                {
                    first = false;
                }
                else
                {
                    sb.Append(delimiter);
                }
                sb.Append(converter(value));
            }
            return sb.ToString();
        }
internal static string BuildDelimitedList < T > ( IEnumerable < T > values , ToStringConverter < T > converter , string delimiter ) { if ( null == values ) { return String . Empty ; } if ( null == converter ) { converter = InvariantConvertToString ; } if ( null == delimiter ) { delimiter = s_defaultDelimiter ; } var sb = new StringBuilder ( ) ; var first = true ; foreach ( var value in values ) { if ( first ) { first = false ; } else { sb . Append ( delimiter ) ; } sb . Append ( converter ( value ) ) ; } return sb . ToString ( ) ; }
Converts an enumeration of values to a delimited string list.
Converts an enumeration of values to a delimited string list .
Delimited list of values in string.
Delimited list of values in string .
values
IEnumerable<T>
Values. If null, returns empty string.
Values . If null returns empty string .
converter
ToStringConverter<T>
Converter. If null, uses default invariant culture converter.
Converter . If null uses default invariant culture converter .
delimiter
string
Delimiter. If null, uses default (', ')
Delimiter . If null uses default ( ' ' )
typeparam
Type of elements to convert.
Type of elements to convert .