32 lines
562 B
Go
32 lines
562 B
Go
// Package wrapper ...
|
|
//
|
|
// Description : wrapper ...
|
|
//
|
|
// Author : go_developer@163.com<白茶清欢>
|
|
//
|
|
// Date : 2023-05-05 13:39
|
|
package wrapper
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestString_ToFloat32(t *testing.T) {
|
|
var str String
|
|
str = "12345.123"
|
|
fmt.Println(str)
|
|
fmt.Println(str.ToFloat32())
|
|
fmt.Println(str.ToFloat64())
|
|
fmt.Println(str.ToNumber())
|
|
fmt.Println(str.ToDouble())
|
|
fmt.Println(str.ToInt())
|
|
fmt.Println(str.ToUint())
|
|
}
|
|
|
|
func TestString_ToAnySlice(t *testing.T) {
|
|
str := "1,2,3"
|
|
r := String(str).ToAnySlice(",")
|
|
fmt.Println(r)
|
|
}
|