我正在寻找的是,如果插入的文本包含字符和整数,并且如果这些不在列表字符中返回 false
示例列表:
List = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]
并且该函数应具有 1 个值,例如:
check(Text) ->
List = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"],
如果插入的文本是:
check("you should have 10 point to do this")
应该返回 true 因为文本中的所有内容都存在于 List 中
如果插入的文本是:
check("you should + have ....")
应该返回 false,因为 List 中不存在“+”和“.”。