Core Utils - 核心工具函数
Core Utils 提供核心工具函数集合。
特性
- 字符串处理
- 数组/切片操作
- 类型转换
- 工具函数
安装
bash
go get github.com/go-zoox/core-utils快速开始
基本使用
go
package main
import (
"fmt"
"github.com/go-zoox/core-utils"
)
func main() {
// 字符串工具
str := " hello world "
trimmed := coreutils.Trim(str)
fmt.Println(trimmed)
// 类型转换
num := coreutils.ToInt("123")
fmt.Println(num)
// 数组操作
arr := []int{1, 2, 3, 4, 5}
contains := coreutils.Contains(arr, 3)
fmt.Println(contains)
}