Skip to content

Commit 9db204d

Browse files
authored
Revert "Revert "33 (java)、题目编号统一修改为四位数""
1 parent cbcdd4c commit 9db204d

File tree

339 files changed

+130
-80
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

339 files changed

+130
-80
lines changed

README.md

Lines changed: 80 additions & 80 deletions

Rename folder.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
package main
2+
3+
import (
4+
"io/ioutil"
5+
"os"
6+
"strings"
7+
)
8+
9+
func main() {
10+
myfolder := "D:/workspace/bluesword/leetcode/solution"
11+
files, _ := ioutil.ReadDir(myfolder)
12+
for _, file := range files {
13+
if file.IsDir() {
14+
name := file.Name()
15+
split := strings.Split(name, ".")
16+
os.Rename(myfolder+"/"+name, myfolder+"/"+"0"+split[0]+"."+strings.TrimSpace(split[1]))
17+
} else {
18+
continue
19+
}
20+
}
21+
22+
/*file := "C:\\\\log\\\\2013.log" //源文件路径
23+
err := os.Rename(file, "C:\\\\log\\\\install.txt") //重命名 C:\\log\\2013.log 文件为install.txt
24+
if err != nil {
25+
//如果重命名文件失败,则输出错误 file rename Error!
26+
fmt.Println("file rename Error!")
27+
//打印错误详细信息
28+
fmt.Printf("%s", err)
29+
} else {
30+
//如果文件重命名成功,则输出 file rename OK!
31+
fmt.Println("file rename OK!")
32+
}*/
33+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)