PatternCollection.TryGetMatchingPattern Method

Namespace
Kampute.DocToolkit.Collections
Assembly
  • Kampute.DocToolkit.dll

Definition

Attempts to retrieve a pattern that matches the specified value.
public bool TryGetMatchingPattern(string value, [NotNullWhen(true)] out string pattern)

Parameters

value string
The value to find a pattern for.
pattern string
When this method returns, contains the pattern that matches the value, if found; otherwise, null. This parameter is passed uninitialized.

Returns

bool
true if a pattern was found; otherwise, false.

Remarks

This method searches for the most specific pattern that matches the value. If the value is an exact match for a pattern in the collection, that pattern is returned. If the value is a sub-segment of a wildcard pattern, the wildcard pattern is returned. If no pattern matches the value, false is returned.