Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 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
它已经过测试。