让命令= //某个shell命令执行,打印一些登录终端
command.description //这给出了字符串表示形式
设textToSearch =“一些字符串值”
//我的方法
设status = command.description.conatains(textToSearch)
XCTAssert(状态,“文本不存在!”) //失败
设status2 = command.description.range(of: textToSearch) != 0
XCTAssert(状态,“文本不存在!”) //失败
发布于 2022-06-22 21:19:19
let command = Foo()
let description = command.description
let textToSearch = "some string value"
let status = description.localizedLowercase.contains(textToSearch.localizedLowercase)
XCTAssertTrue(status, "The Text is not present!")https://stackoverflow.com/questions/72391988
复制相似问题