containerKey method
json中是否包含指定的键
keyName
键名称
Implementation
bool containerKey(String keyName) {
if (keyName.isEmptyString) {
return false;
}
if (this.isEmptyJson) {
return false;
}
String regex = "(((\"" + keyName + "\")|('" + keyName + "')):(.*?)((\\,|\\})(\\s\\S)*))";
var hasMatch = new RegExp(regex).hasMatch(this ?? "");
return hasMatch;
}