Sitecore 5.1.1 API

StringUtil.StringCollectionToString Method (StringCollection, String)

Converts a string collection to a string

[Visual Basic]
Overloads Public Shared Function StringCollectionToString( _
   ByVal collection As StringCollection, _
   ByVal delimiter As String _
) As String
[C#]
public static string StringCollectionToString(
   StringCollection collection,
   string delimiter
);

Parameters

collection
A collection of strings.
delimiter
A string to put between each of the strings in the collection.

Return Value

The strings in collection concatenated with the delimiter in between.

Example

  StringCollection list = new StringCollection();
  list.Add("1");
  list.Add("2");
  list.Add("3");
  string result = StringUtil.StringCollectionToString(list, "|"); / "1|2|3"

See Also

StringUtil Class | Sitecore Namespace | StringUtil.StringCollectionToString Overload List