验证Json对象中存在List <String>的值并返回True或False

我正在尝试验证-Just save that to a text file and give it a name (for example DTSconverter.sh) -Make it executable -Put it in the root directory where the movies you wish to work on are stored -Create a folder called 'Temp" in the that same root directory -Execute the script by opening a terminal in the root directory and typing ./DTSconverter.sh (or whatever file name you gave the script) 是否存在props:List<String>值,并返回该值是true还是false。

message:String

我真的不知道如何继续验证

iCMS 回答:验证Json对象中存在List <String>的值并返回True或False

不确定这是否是您要查找的内容,但是会覆盖单词中的每个对象,并且如果邮件中不包含x,则返回false,否则返回true。

for(x in words){
    if(!messagejson.containsKey(x))
        return false

}
return true
}
,

除了使用循环,您还可以编写:

fun validator(message: String,props: List<String>) =
        props.any { message.contains(it) }
本文链接:https://www.f2er.com/2111463.html

大家都在问