Method TryAdd
- Namespace
- DisCatSharp.Common
- Assembly
- DisCatSharp.Common.dll
TryAdd(string, TValue?)
Attempts to insert a specific key and corresponding value into this dictionary.
public bool TryAdd(string key, TValue? value)
Parameters
key
stringKey to insert.
value
TValueValue corresponding to this key.
Returns
- bool
Whether the operation was successful.
TryAdd(ReadOnlySpan<char>, TValue?)
Attempts to insert a specific key and corresponding value into this dictionary.
public bool TryAdd(ReadOnlySpan<char> key, TValue? value)
Parameters
key
ReadOnlySpan<char>Key to insert.
value
TValueValue corresponding to this key.
Returns
- bool
Whether the operation was successful.