|
StringExtensionsJoinKeyValuePairs Method
|
Combines a dictionary of key-value pairs in to a string.
Namespace: GSFAssembly: GSF.Core (in GSF.Core.dll) Version: 2.4.207-beta+1781b796b2aa7a54013a031eb432fe4ccee31867
Syntax [<ExtensionAttribute>]
static member JoinKeyValuePairs :
pairs : IDictionary<string, string> *
?parameterDelimiter : char *
?keyValueDelimiter : char *
?startValueDelimiter : char *
?endValueDelimiter : char
(* Defaults:
let _parameterDelimiter = defaultArg parameterDelimiter ';'
let _keyValueDelimiter = defaultArg keyValueDelimiter '='
let _startValueDelimiter = defaultArg startValueDelimiter '{'
let _endValueDelimiter = defaultArg endValueDelimiter '}'
*)
-> string
GSF.StringExtensions.JoinKeyValuePairs = function(pairs, parameterDelimiter, keyValueDelimiter, startValueDelimiter, endValueDelimiter);
View SourceParameters
- 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
StringA 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