Jump to content
Sign in to follow this  
AliMag

String manipulation

Recommended Posts

Hi,

Is there any commands related to string manipulation?

Like finding if a word is in a sentence...

I remember that there was none in OFP and I'm hoping that some were included in Arma 2. This is much needed.

Thanks in advance

Cheers

Share this post


Link to post
Share on other sites

Hi,

Thanks for the quick reply. Unfortunately nothing as really change from OFP. You can concatenate 2 strings together but cannot find/extract part of a string.

It would be nice, for example, to be able to find "_SD_" in a string of ammo to know if it silenced or not. Maybe in a future patch...

Thanks again

Cheers

Share this post


Link to post
Share on other sites

You could probably check the config of that ammo to see if it's silenced.

Also, it's abolutely possible to search a string, you'll just have to make a function for it youself. Have a look at the http://www.arma2.com/comref/full.html#toArrayString command. You could use that to split an string into an array of words and use the "find" command on it. Or in case of the ammo you could rather easily check only the last 2 letters.

Aside from that, you could use kronzkys string-functions. http://kronzky.info/snippets/strings/index.htm

They may not be optimized for ArmA2, but should still work nicely.

Edited by Tajin

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×