![](/profiles/wavemetrics/themes/wavemetrics/logo.png)
IF command with strings
![](/sites/default/files/styles/thumbnail/public/default_images/Artboard%201_1.png?itok=jeHOCIXy)
andreponzoni
I would like to know how to use the IF command to check string variables, to do something like this:
string Svar IF ( Svar=="ABC" ) // do this Else // do that EndIf
I know it is a silly question, and should have a simple solution.. but I've been stuck with this for a long while, and I have found just examples with numeric variables.
Thanks
Andre
January 29, 2015 at 03:05 am - Permalink
I will take a look! Thanks!
January 29, 2015 at 03:10 am - Permalink
I would not use "svar" as string name, because SVAR is used as global string declaration.
January 29, 2015 at 03:11 am - Permalink
The name of the variable was just an example.. but well reminded!
Thanks you all!
Andre
January 29, 2015 at 03:26 am - Permalink
stringmatch
for this use. The help page for stringmatch lists a few other useful string handling functions.January 29, 2015 at 05:42 am - Permalink
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
January 29, 2015 at 10:12 am - Permalink
GrepString
,which would allow you to match all of "abc1", "abc2", "abc3" using "abc"
(or even "abc\d{1}")
February 5, 2015 at 01:17 am - Permalink
SelectString
comes in handy.February 5, 2015 at 01:24 am - Permalink