EnumerableExtensionsToStringKeyedDictionaryTValue(IEnumerableTValue, FuncTValue, String, StringSegmentComparer) Method
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static StringKeyedDictionary<TValue> ToStringKeyedDictionary<TValue>(
this IEnumerable<TValue> source,
Func<TValue, string> keySelector,
StringSegmentComparer? comparer = null
)
<ExtensionAttribute>
Public Shared Function ToStringKeyedDictionary(Of TValue) (
source As IEnumerable(Of TValue),
keySelector As Func(Of TValue, String),
Optional comparer As StringSegmentComparer = Nothing
) As StringKeyedDictionary(Of TValue)
public:
[ExtensionAttribute]
generic<typename TValue>
static StringKeyedDictionary<TValue>^ ToStringKeyedDictionary(
IEnumerable<TValue>^ source,
Func<TValue, String^>^ keySelector,
StringSegmentComparer^ comparer = nullptr
)
[<ExtensionAttribute>]
static member ToStringKeyedDictionary :
source : IEnumerable<'TValue> *
keySelector : Func<'TValue, string> *
?comparer : StringSegmentComparer
(* Defaults:
let _comparer = defaultArg comparer null
*)
-> StringKeyedDictionary<'TValue>
- source IEnumerableTValue
- The source collection to create a StringKeyedDictionaryTValue from.
- keySelector FuncTValue, String
- A delegate to produce a key for each element in the source collection.
- comparer StringSegmentComparer (Optional)
- A StringSegmentComparer to compare keys. If , then ordinal comparison will be used. This parameter is optional.
Default value: .
- TValue
- The type of the elements in the source collection and the type of the values in the returned StringKeyedDictionaryTValue.
StringKeyedDictionaryTValueA
StringKeyedDictionaryTValue that contains the same values that are in
source associated with keys returned created
by the specified
keySelector.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTValue. 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).