增加string包装类型

This commit is contained in:
2023-05-05 13:43:33 +08:00
commit cb65c45739
5 changed files with 750 additions and 0 deletions

25
string_test.go Normal file
View File

@ -0,0 +1,25 @@
// 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())
}