public static void main(String[] args) {
// 从 classpath 读取资源文件
try (InputStream is = MerchantNoTest.class.getClassLoader()
.getResourceAsStream("merchant.txt")) {
assert is != null;
try (BufferedReader reader = new BufferedReader(
new InputStreamReader(is, StandardCharsets.UTF_8))) {
List<String> merchantNos = reader.lines()
.map(String::trim)
.filter(s -> !s.isEmpty())
.collect(Collectors.toList());
String inClause = merchantNos.stream()
.map(no -> "'" + no + "'")
.collect(Collectors.joining(", "));
System.out.println(" (" + inClause + ")");
}
} catch (Exception e) {
e.printStackTrace();
}
}
02-20
4025
4025
03-02
2万+
2万+

被折叠的 条评论
为什么被折叠?



