You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 23 Next »
gstr提供了丰富的字符串处理。组件内置了90+个常用的字符串处理方法。
gstr
90+
使用方式:
import "github.com/gogf/gf/text/gstr"
接口文档:
https://godoc.org/github.com/gogf/gf/text/gstr
示例:
func ExampleAddSlashes() { var str string str = `'aa'"bb"cc\r\n\d\t` rsStr := gstr.AddSlashes(str) fmt.Println(rsStr) // Output: // \'aa\'\"bb\"cc\\r\\n\\d\\t }