List<BtseHistory> locations = influxDbConnection.getInfluxQuery(BtseHistory.class, sql);
Map<String, Object> map = new HashMap<>();
Set<BtseHistory> historySet = new HashSet<>(locations);
List<BtseHistory> list = historySet.stream().sorted(Comparator.comparingInt(value -> Integer.parseInt(value.getLn().substring(13, 15)))).collect(Collectors.toList());
// 转成Json数据存map
map.put("key", Json.toJson(list));
list.forEach(System.out::println);
在这个方法截取的时候会有不同位数的数字,字符串如下,这样多变的字符串截取该如何处理呢
celGGIO1.AnIn7......
celGGIO1.AnIn8......
celGGIO1.AnIn9......
celGGIO1.AnIn10......
celGGIO1.AnIn11......
celGGIO1.AnIn12......
celGGIO1.AnIn13......
celGGIO1.AnIn14......
celGGIO1.AnIn15......
celGGIO1.AnIn16......
celGGIO1.AnIn17......
celGGIO1.AnIn18......
celGGIO1.AnIn19......
celGGIO1.AnIn20......
celGGIO1.AnIn1.mag.f
完整字符串如上,直到 AnIn1000,对与多变的字符串处理,请问如何解决呢