Sitecore 5.0 API

StringUtil.GetNameValues Method (String[])

Gets a name/value collection from a string array.

[Visual Basic]
Overloads Public Shared Function GetNameValues( _
   ByVal list As String() _
) As NameValueCollection
[C#]
public static NameValueCollection GetNameValues(
   string[] list
);

Parameters

list
An array of strings.

Return Value

A name/value collection.

Remarks

The name/value collection is built by using values from the string array in pairs. A string array consisting of { "Name1, "Value1", "Name2", "Value2" } are converted to ("Name1", "Value1"), ("Name2", "Value2").

Example

  NameValueCollection collection = StringUtil.GetNameValues(new string[] {"Name1", "Value1", "Name2", "Value2" });

See Also

StringUtil Class | Sitecore Namespace | StringUtil.GetNameValues Overload List