How to pattern match the string



in this I want to pattern match the string lunch.
if they type lunch money. I want to match the string lunch in that

how to use the regular expression to match the string.


You can use the CSharp Contains method returns true if and only if this string contains the specified sequence of char values.

If the str Contains in the String then it returns true

If the str does not Contains in the String it returns False

For ex: “This is a Test”.Contains(“is”) return True

“This is a Test”.Contains(“yes”) return False



can we use the regular expression for this


yes try below below one

System.Text.RegularExpressions.Regex.IsMatch(“My name is Bhanu”,“Bhanu”)

it returns boolean value as output


ok ill try this


You can try also isMatch activity directly


hi iam try to match the Lunch in switch its not comming .


Hi @akshaygm12,

Instead of IsMatch, you can also make use of string.contains.


and also how can i convert a string to upper case .




ya got it .any one help me with the string matching in case


That means String matching should be case sensitive?


no match the string in the switch if it match then do some operation


Maybe this post will be useful it the string value is known.

If the string values changes and only part of the string value matches the case value,