Checking a variable for a substring

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

Checking a variable for a substring

Postby jessican » Fri Jun 17, 2016 12:50 pm

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

Postby FrancescoT » Mon Jun 20, 2016 8:43 am

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

Postby jessican » Wed Jun 22, 2016 8:39 am

Thanks so much!

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Checking a variable for a substring

Postby FrancescoT » Wed Jun 22, 2016 12:54 pm

: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


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 80 guests