Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wild card on an if statement

Status
Not open for further replies.

vodkadrinker

Technical User
May 16, 2002
163
GB
Can I do a wild card in an if statement? something along the lines of ...

if (a != 123*)

So as to say if a is not qual to anything starting with 123

Regards
VD
 
Only ways I can think of would be to use some kind of loop and divide the number by ten until it's less than 1, and then multiply that by 1000 and then getting rid of the decimals. Another solution would be to convert the number to a string, and then compare the characters to the numbers.

//Daniel
 
In other words, no there's nothing built into the language that can do that, but it's not difficult to write a function to do the wildcarding for you.
 
Not for numbers, but use substr() for strings...and then look for nopos... But no, the language doesn't have wild card chars.
 
Thanks jstreich I think substr may be what I'm looking for, sorry if I confused people with the numbers as I'm actually looking for words.

Thanks all
VD
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top