How to pattern match the string

studio

#1

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.


#2

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

Regards,
Prashant


#3

can we use the regular expression for this


#4

yes try below below one

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

it returns boolean value as output


#5

ok ill try this


#6

You can try also isMatch activity directly


#7

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


#8

Hi @akshaygm12,

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


#9

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


#10

string.toupper


#11

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


#12

That means String matching should be case sensitive?


#13

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


#14

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,