Home   Help Search Login Register  

Author Topic: Checking "inside" the strings  (Read 414 times)

0 Members and 1 Guest are viewing this topic.

lizardx

  • Guest
Checking "inside" the strings
« on: 04 Jun 2004, 13:12:53 »
Sorry if I wasn't correct enough in the subject, my English is rather poor...
Is there a way to check wheter a specific character chain is in a string?
Example:
variable1= "blablaABCblabla"
variable2="blablaDEFblabla"
the characters I'm looking for: "ABC"

what I want: a script, a function, whatever will work like this

["ABC",variable1,variable2] exec/call "WHATIWANT.sqs/sqf"

and it results

"true", "false"

Simple request, isn't it? Thx in advance!

Offline Jezuro

  • Members
  • *
  • Hookah 4 lyfe!
    • Jezuro's ArmA Workshop
Re:Checking "inside" the strings
« Reply #1 on: 06 Jun 2004, 20:08:33 »
Sorry, but I must say I think it's not possible  :P
You cannot check the characters in words (strings), eg

? "MyBigGun" in "ThisIsMyBigGun" : hint "It's there!"

The OFP engine lets you only search the values in arrays:

? "G" in ["G","u","n"] : hint "The word -GUN- has a -G- character!"
"We are Her salvation, and through Her command we shall live forever. I will not die. Not here. Not now. Never!!!"