Sitecore 5.0 API

MainUtil.ConvertToNameValues Method (String, Char)

Converts a string to name/value collection.

[Visual Basic]
Overloads Public Shared Function ConvertToNameValues( _
   ByVal values As String, _
   ByVal separator As Char _
) As NameValueCollection
[C#]
public static NameValueCollection ConvertToNameValues(
   string values,
   char separator
);

Parameters

values
A string of seperated values.
separator
A seperator character.

Return Value

A name/value collection.

Remarks

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

Example

  NameValueCollection collection = MainUtil.ConvertToNameValues("Name1|Value1|Name2|Value2", '|');

See Also

MainUtil Class | Sitecore Namespace | MainUtil.ConvertToNameValues Overload List