LikeComparesExtensions
Ecng.ComponentModel
Provides extension methods for comparing string values using a specified comparison operator.
Methods
Like
public static bool Like(string value, string like, ComparisonOperator? likeCompare)
result = LikeComparesExtensions.Like(value, like, likeCompare)
Determines if the specified string value matches a pattern based on the provided comparison operator.
- value
- The string value to evaluate.
- like
- The pattern to compare against.
- likeCompare
- The comparison operator to use for the evaluation.
Returns: True if the value satisfies the comparison; otherwise, false.
ToExpression
public static string ToExpression(string like, ComparisonOperator? likeCompare)
result = LikeComparesExtensions.ToExpression(like, likeCompare)
Converts a pattern into an expression according to the specified comparison operator.
- like
- The pattern to convert.
- likeCompare
- The comparison operator that determines how the expression is formed. Defaults to ComparisonOperator.In if null.
Returns: A string expression representing the pattern.