| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- package util
- import (
- "fmt"
- "testing"
- "time"
- )
- func TestSplitChar(t *testing.T) {
- {
- char := SplitIgnoreSpace(" hello.world ", ".")
- fmt.Println(char)
- }
- {
- char := SplitIgnoreSpace(".hello.world", ".")
- fmt.Println(char)
- }
- {
- char := SplitIgnoreSpace("hello. .world.", ".")
- fmt.Println(char)
- }
- {
- char := SplitIgnoreSpace(".hello.world.", ".")
- fmt.Println(char)
- }
- }
- func TestToString(t *testing.T) {
- t.Log(ToString("11111"))
- t.Log(ToString(1111))
- t.Log(ToString(1111.111))
- t.Log(ToString(time.Now()))
- t.Log(ToString([]string{"1", "2"}))
- t.Log(ToString(map[string]string{"1": "2", "2": "3"}))
- }
- func TestJoinIgnoreSpace(t *testing.T) {
- t.Log(JoinIgnoreSpace([]string{"1", "2", "3"}, ","))
- t.Log(JoinIgnoreSpace([]string{"1", "", "3"}, " || "))
- }
|