StringExtensionsJoinKeyValuePairs Method

Combines a dictionary of key-value pairs in to a string.

Definition

Namespace: Gemstone.StringExtensions
Assembly: Gemstone.Common (in Gemstone.Common.dll) Version: 1.0.128 -- Release Build+d050cfc5563c89a1188cc3c6b2d417530856f490
public static string JoinKeyValuePairs(
	this IDictionary<string, string> pairs,
	char parameterDelimiter = ';',
	char keyValueDelimiter = '=',
	char startValueDelimiter = '{',
	char endValueDelimiter = '}'
)

Parameters

pairs  IDictionaryString, String
Dictionary of key-value pairs.
parameterDelimiter  Char  (Optional)
Character that delimits one key-value pair from another (e.g. ';').
keyValueDelimiter  Char  (Optional)
Character that delimits a key from its value (e.g. '=').
startValueDelimiter  Char  (Optional)
Optional character that marks the start of a value such that value could contain other parameterDelimiter or keyValueDelimiter characters (e.g., "{").
endValueDelimiter  Char  (Optional)
Optional character that marks the end of a value such that value could contain other parameterDelimiter or keyValueDelimiter characters (e.g., "}").

Return Value

String
A string of key-value pairs.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IDictionaryString, String. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

Values will be escaped within startValueDelimiter and endValueDelimiter to contain nested key/value pair expressions like the following: normalKVP=-1; nestedKVP={p1=true; p2=0.001}, when either the parameterDelimiter or keyValueDelimiter are detected in the value of the key/value pair.

See Also