4

如何从现有地图中删除密钥?

if (exists $sampleMap{1})
{
      #Here I want to remove the "1" key from sampleMap
}
4

1 回答 1

9

用于delete删除哈希键:

if (exists $sampleMap{1})
{
      delete $sampleMap{1}; #Here I want remove the "1" key from sampleMap.
}

有关更多详细信息,请查看delete

于 2013-08-28T05:38:36.120 回答