Fandom

武装突袭 Wiki

Find

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 分享

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

  

点击图片可看到更多讯息

开始使用于

游戏:
Armed Assault
版本:
1.00

描述

描述:
Searches for an array element within array or a string within a string. Returns the 0 based index on success or -1 if not found. Test is cASe-seNsItiVE

基本句法

句法:
array find x
参数:
array: Array - array to search in

x: Anything - array element to find
返回值:
Number - 0 based position of the first array element that matches x, -1 if not found

替代句法

句法:
string find x           (since ["Arma 3","Arma3",127,126674,"Development"])
参数:
string: String - string to search in

x: String - string to find
返回值:
Number - 0 based position of the first sequence of characters that matches x, -1 if not found

范例

范例1:
["Apples","Oranges","Pears"] find "Oranges"; //result is 1 [1,[2],[[3]]] find [[3]]; //result is 2

范例2:
if (magazines player find "Strela" >= 0) then {hint "You've got Strela!"};

范例3:
hint str ("japa is the man!" find "the man!"); //8

额外资讯

多人游戏:
-
也可以看看:

setresizereverseselectintoArraytoStringforEachcountpushBackpushBackUniqueapplydeleteAtdeleteRangeappendsortparamparamsarrayIntersectsplitStringjoinString

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Bottom Section

Posted on January 4, 2015 - 09:38 (UTC)
Heeeere's Johnny!
Using nil on either side of find will make the whole statement return Nothing: _array = [1,2,nil,4,5]; _result = _array find nil; hintSilent str (isNil "_result"); //true

_result = nil find 1; hintSilent str (isNil "_result"); //true

Posted on April 10, 2015 - 17:01 (UTC)
Kenoxite
Find doesn't work with multidimensional arrays in OFP/CWA. It will always returns -1.

更多维基

随机维基