Match specifik word from variable

How can i match a word from variable…
var Filename = UserID-02-CaseID-004-Maximum.xlsx
var Project = Maximum

Matching word is = Maximum

I want to match the word Maximum of those 2 varible to the Excel row value in a IF statement…

can someone help…

To Chevk whether a string contains this word or substring

Using stringvar.Contains(varaible)

Use this in if condition

Hope it helps

Mark it as solution if you got it

Nived N :robot:

Happy Automation :slight_smile::slight_smile::slight_smile:

1 Like

If Filename.Contains(“Maximum”) AndAlso Project.Contains(“Maximum”)

keep in mind that the .Contains() method is case sensitive. If you want to capture regardless of capitalization you can convert everything to upper/lower e.g. Filename.ToUpper.Contains(“MAXIMUM”)

1 Like

Thanks its worked… just need little more help is this

Project variable comes with = Maximumlist
So i need to cut this “list” as its not in the parh… how to trim that or cut that…

And i need first letter to not be capitle… means by,
Project have M capitel as Maxium… and Path have not M capitel… so i need to lover that letter…

Thanks for the help @Dave I have solved rest of the issue…
Its working now…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.