您好,有以下字符串,
Let\342\200\231s start with the most obvious question first. This is what an \342\200\234unfurl\342\200\235 is
它应该显示为 前三个数字 ( \342\200\231) 实际上表示一个八进制序列http://graphemica.com/%E2%80%99,它的 unicode 等效项是\u2019
类似地\342\200\234表示八进制序列http://graphemica.com/%E2%80%9C,其等效的 unicode 是\u201C
是否有任何库或函数可以用来将这些八进制序列转换为其等效的 unicode 序列?
我有一个CSV文件,第一行有一个标题.我想将其转换为List<Map<String, String>>,其中Map<String, String>列表中的每个代表文件中的记录.地图的关键是标题,值是字段的实际值.到目前为止我所拥有的:
BufferedReader br = <handle to file>;
// Get the headers to build the map.
String[] headers = br.lines().limit(1).collect(Collectors.toArray(size -> new String[size]));
Stream<String> recordStream = br.lines().skip(1);
Run Code Online (Sandbox Code Playgroud)
我可以执行哪些进一步操作recordStream以便将其转换为List<Map<String, String>>?
示例CSV文件是:
header1,header2,header3 ---- Header line
field11,field12,field13 ----> need to transform to Map where entry would be like header1:field11 header2:field12 and so on.
field21,field22,field23
field31,field32,field33
Run Code Online (Sandbox Code Playgroud)
最后,需要将所有这些地图收集到列表中.