Skip to content

Commit df5d07a

Browse files
修改命名规范
1 parent 0b146ff commit df5d07a

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

src/main/java/com/CsvUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class CsvUtils {
2323
* @param outPutPath
2424
* @param filename
2525
*/
26-
public static void createCSVFile(String[] heads, List<Object[]> rows, String outPutPath, String filename)
26+
public static void createCsvFile(String[] heads, List<Object[]> rows, String outPutPath, String filename)
2727
{
2828

2929
// CsvWriter (and all other file writers) work with an instance of
@@ -64,7 +64,7 @@ public static void createCSVFile(String[] heads, List<Object[]> rows, String out
6464
* @return
6565
* @throws IOException
6666
*/
67-
public static List<String[]> ReadCSV(String filePath) throws IOException {
67+
public static List<String[]> readCsv(String filePath) throws IOException {
6868
// List<Object> eslImports = new ArrayList<Object>();
6969
File file = new File(filePath);
7070
InputStream in = new FileInputStream(file);
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package com.collection.list;
2+
3+
import java.util.Arrays;
4+
import java.util.List;
5+
6+
public class ListUtils {
7+
8+
public static String listToString(List<String> list){
9+
if(list==null){
10+
return null;
11+
}
12+
StringBuilder result = new StringBuilder();
13+
boolean first = true;
14+
//第一个前面不拼接","
15+
for(String string :list) {
16+
if(first) {
17+
first=false;
18+
}else{
19+
result.append(",");
20+
}
21+
result.append(string);
22+
}
23+
return result.toString();
24+
}
25+
26+
public static List<String> stringToList(String strs){
27+
String[] str = strs.split(",");
28+
return Arrays.asList(str);
29+
}
30+
}

0 commit comments

Comments
 (0)