【发布时间】:2023-03-18 18:24:02
【问题描述】:
如何使用填充属性文件中的值的映射替换单词?
我有这个代码来加载属性文件:
Properties propertiesSlang = new Properties();
FileInputStream fileReadSlang = new FileInputStream(slang);
propertiesSlang.load(fileReadSlang);
System.out.println(propertiesSlang);
Map<String, String> replacements = new HashMap<String, String>((Map)propertiesSlang);
我有很多俚语要替换,我该如何替换俚语?
【问题讨论】:
-
你想做什么?问题不清楚。
-
您是否尝试这样做:javaworld.com/article/2076568/learn-java/localize-this-.html? (本地化)
-
查看替换字符串中单词的通用解决方案stackoverflow.com/a/1326962/1737819。
标签: java replace hashmap tokenize