Dart编程实例 - 从HashMap删除值

本文为大家分享 Dart编程实例 - 从HashMap删除值 的具体示例代码,提供大家参考,具体内容如下:

import 'dart:collection';
main() {
   var accounts = new HashMap();
   accounts['dept'] = 'HR';
   accounts['name'] = 'Tom';
   accounts['email'] = 'tom@xyz.com';
   print('Map after adding  entries :${accounts}');
   accounts.remove('dept');
   print('Map after removing  entry :${accounts}');  
   accounts.clear();
   print('Map after clearing entries :${accounts}');
}

本文为大家分享 Dart编程实例 - HashSet 的具体示例代码,提供大家参考,具体内容如下:import 'dart:collection'; void main() { Set numberS ...