Click or drag to resize

HierarchyPatternMatch Method

Checks target string against a simple pattern which allows prefix, suffix, and contains match. The match is case-sensitive.

Namespace:  KSPDev.ModelUtils
Assembly:  KSPDev_Utils.2.0 (in KSPDev_Utils.2.0.dll) Version: 2.0 for KSP v1.8+
Syntax
C#
public static bool PatternMatch(
	string pattern,
	string target
)
Request Example View Source

Parameters

pattern
Type: SystemString
Pattern to match for:
  • If pattern ends with * then it's a match by prefix.
  • If pattern starts with * then it's a match by suffix.
  • If pattern starts and ends with * then pattern is searched anywhere in the target.
target
Type: SystemString
The target string to check.

Return Value

Type: Boolean
true if pattern matches the target.
See Also