我正在打印存储在地图中的字符串值,但我不希望它打印 [] 或 , 分隔符。如何仅打印值?
Iterator<String> iterator = styles.keySet().iterator();
while (iterator.hasNext()) {
String key = iterator.next().toString();
String value = styles.get(key).toString();
stylePlaceHolder = value + "\n";
}
siteElements.add(stylePlaceHolder);
Iterator<String> iterator2 = libraries.keySet().iterator();
while (iterator2.hasNext()) {
String key = iterator2.next().toString();
String value = libraries.get(key).toString();
libPlaceHolder = value + "\n";
System.out.println(libraries.values().toString());
}
生成:
03-23 17:56:56.350: I/System.out(9642143): [<script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
03-23 17:56:56.350: I/System.out(9642143):
, <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.
min.css" />
03-23 17:56:56.350: I/System.out(9642143): , <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
03-23 17:56:56.350: I/System.out(9642143):
]