Checking a variable for a substring

Got a problem you cannot solve? Try here.
Post Reply
jessican
Posts: 29
Joined: Fri May 13, 2016 9:01 am

Checking a variable for a substring

Post by jessican »

Hi!

So lets say I have a variable named sunSet which holds the string "overTheHills"

and I want to check the last 5 positions of the string sunSet to see if it holds the word "Hills"

If it does, I want to execute a set of functions, and if it doesn't, I want to do something else..

Is it possible to only check the last specified positions? like starting from the end of the string?

For example if I searched the String "OverHillsThe", I don't want the check to go through..
I want it to be true only if Hills is at the end of the string.

So the "contains" function wouldn't work..
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Checking a variable for a substring

Post by FrancescoT »

Dear Jessican,

you may use "Parse String" command.
http://www.installaware.com/forums/view ... ing#p38296

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
jessican
Posts: 29
Joined: Fri May 13, 2016 9:01 am

Re: Checking a variable for a substring

Post by jessican »

Thanks so much!
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Checking a variable for a substring

Post by FrancescoT »

:D :D :D
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply