Documentation ¶
Overview ¶
字符串处理工具包
Index ¶
- func ClearSpace(s string) string
- func DelQue(que []string, ss ...string) []string
- func InQue(s string, que []string) int
- func InQuei(s string, que []string) int
- func Lcfirst(str string) string
- func PadLeft(s string, pad string, le int) string
- func PadRight(s string, pad string, le int) string
- func Render(tpl string, data interface{}) (string, error)
- func Reverse(s string) string
- func SplitSafe(s, sep string) []string
- func Ucfirst(str string) string
- type Url
- type WriterToContent
- Bugs
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Url ¶ added in v0.5.0
type Url struct { }
URL 相关处理类
func (Url) AbsHref ¶ added in v0.5.0
获取路径的绝对地址: path 地址路径, url 为顶级路径可为空
Example ¶
var u Url // "joshua/conero" 与 "./joshua/conero" 效果相同 fmt.Println(u.AbsHref("joshua/conero", "https://www.about.me/url/example/test")) fmt.Println(u.AbsHref("/joshua/conero", "https://www.about.me/url/example/test")) // "//" 等符合可被清除 fmt.Println(u.AbsHref("//joshua/conero", "https://www.about.me/url/example/test")) fmt.Println(u.AbsHref("../../joshua/conero", "https://www.about.me/url/example/test"))
Output: https://www.about.me/url/example/test/joshua/conero https://www.about.me/joshua/conero https://www.about.me/joshua/conero https://www.about.me/joshua/conero
type WriterToContent ¶ added in v0.3.1
type WriterToContent struct {
// contains filtered or unexported fields
}
写入器导出为内容
Notes ¶
Bugs ¶
Url.AbsHref 中解析 "vpath" `test/p1/p2` 与 `./test/p1/p2` 的一致性问题
Click to show internal directories.
Click to hide internal directories.