简体   繁体   English

从 HashMap 中获取包含键子串的对象

[英]Get object from HashMap which contains key substring

I have a Map object which has COM-20 HELLO as key and My name as value.我有一个 Map 对象,它的键是COM-20 HELLOMy name是值。

Is there any way to get this object by indicating that I want the key that contains COM-20 without the HELLO有没有办法通过指示我想要包含COM-20而不带HELLO的密钥来获取此对象

Thanks.谢谢。

Keys should be unique, if you have a map with keys like: COM-20 HELLO1 and COM-20 HELLO2 what should it return?键应该是唯一的,如果你有一个带有像这样的键的映射:COM-20 HELLO1 和 COM-20 HELLO2 它应该返回什么? both of them?两个都? It is not possible.这不可能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM