EnumerableExtensionsToStringKeyedDictionaryTSource, TValue(IEnumerableTSource, FuncTSource, String, FuncTSource, TValue, StringSegmentComparer) Method
Namespace: KGySoft.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
public static StringKeyedDictionary<TValue> ToStringKeyedDictionary<TSource, TValue>(
this IEnumerable<TSource> source,
Func<TSource, string> keySelector,
Func<TSource, TValue> valueSelector,
StringSegmentComparer? comparer = null
)
<ExtensionAttribute>
Public Shared Function ToStringKeyedDictionary(Of TSource, TValue) (
source As IEnumerable(Of TSource),
keySelector As Func(Of TSource, String),
valueSelector As Func(Of TSource, TValue),
Optional comparer As StringSegmentComparer = Nothing
) As StringKeyedDictionary(Of TValue)
public:
[ExtensionAttribute]
generic<typename TSource, typename TValue>
static StringKeyedDictionary<TValue>^ ToStringKeyedDictionary(
IEnumerable<TSource>^ source,
Func<TSource, String^>^ keySelector,
Func<TSource, TValue>^ valueSelector,
StringSegmentComparer^ comparer = nullptr
)
[<ExtensionAttribute>]
static member ToStringKeyedDictionary :
source : IEnumerable<'TSource> *
keySelector : Func<'TSource, string> *
valueSelector : Func<'TSource, 'TValue> *
?comparer : StringSegmentComparer
(* Defaults:
let _comparer = defaultArg comparer null
*)
-> StringKeyedDictionary<'TValue>
- source IEnumerableTSource
- The source collection to create a StringKeyedDictionaryTValue from.
- keySelector FuncTSource, String
- A delegate to produce a key for each element in the source collection.
- valueSelector FuncTSource, TValue
- A delegate to produce a value 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: .
- TSource
- The type of the elements in the source collection.
- TValue
- The type of the value returned by the specified valueSelector.
StringKeyedDictionaryTValueA
StringKeyedDictionaryTValue that contains values of type
TValue created by the specified
valueSelector
for each elements in the
source collection.In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableTSource. 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).