2 Star 1 Fork 1

mosache/YFrame

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
str.go 474 Bytes
Copy Edit Raw Blame History
ヤ沒脩袮兲︶ authored 2023-02-21 17:59 . init
/*
切片转字符串相关
*/
package slicex
import (
"gitee.com/mosache/YFrame/core/common/strx"
"strings"
)
func ToStrSlice[T any](s []T) []string {
var r []string
slice := make(Slice[T, string], 0)
for _, e := range s {
slice = append(slice, e)
}
r = slice.Map(func(e T) string {
return strx.ToStr(e)
})
return r
}
func Join[T any](source []T, sep string) string {
if source == nil {
return ""
}
return strings.Join(ToStrSlice(source), sep)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mosache/YFrame.git
git@gitee.com:mosache/YFrame.git
mosache
YFrame
YFrame
v0.1.80

Search