ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# AddOrReplaceInKeyValues `AddOrReplaceInKeyValues(KeyValues, Key, Value)` `KeyValues`-`{Collection}` `Key`-`{String}` `Value`-`{Variant}` Helper用于在`KeyValue`的`Collection`中添加/替换`KeyValue` * 如果找不到key则添加 * 如果找到key则替换 ~~~vb Dim KeyValues As New Collection KeyValues.Add WebHelpers.CreateKeyValue("a", 123) KeyValues.Add WebHelpers.CreateKeyValue("b", 456) KeyValues.Add WebHelpers.CreateKeyValue("c", 789) WebHelpers.AddOrReplaceInKeyValues KeyValues, "b", "abc" WebHelpers.AddOrReplaceInKeyValues KeyValues, "d", "def" '// -> [ '// {"Key":"a","Value":123}, '// {"Key":"b","Value":"abc"}, '// {"Key":"c","Value":789}, '// {"Key":"d","Value":"def"} '// ] ~~~