如何在 iOS 自动化脚本中搜索字符串中的子字符串? indexOf() 和 search() 方法不起作用。
最佳答案
var text = target.frontMostApp().navigationBar().staticTexts()[0].value();
var index = text.indexOf("text that looking for");
UIALogger.logDebug("index is: " + i); // -1 means not found
已经过测试。
关于javascript - 如何在iOS自动化脚本中搜索字符串中的子字符串? indexOf() 和 search() 方法不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16437556/