Files
OpenList/test/string_test.go

21 lines
389 B
Go
Raw Normal View History

package test
import (
"fmt"
"strings"
"testing"
)
func TestSplit(t *testing.T) {
2021-03-05 21:25:44 +08:00
drive_id := "/123/456"
strs := strings.Split(drive_id, "/")
fmt.Println(strs)
2021-03-05 21:25:44 +08:00
}
2021-03-06 23:19:16 +08:00
func TestPassword(t *testing.T) {
fullName:="hello.password-xhf"
index:=strings.Index(fullName,".password-")
name:=fullName[:index]
password:=fullName[index+10:]
fmt.Printf("name:%s, password:%s\n",name,password)
}