Documentation ¶
Index ¶
- Variables
- type FileOperate
- type FileSystem
- type SnakeString
- func (t *SnakeString) Add(str ...interface{}) *SnakeString
- func (t *SnakeString) AddSlice(dts []interface{}) *SnakeString
- func (t *SnakeString) Between(start, end string) *SnakeString
- func (t *SnakeString) Byte() []byte
- func (t *SnakeString) CamelCase() *SnakeString
- func (t *SnakeString) Charset() (string, bool)
- func (t *SnakeString) Copy(length int) string
- func (t *SnakeString) DeBase(base int) *SnakeString
- func (t *SnakeString) DrawBox(width int, chars ...pkg.Box9Slice) *SnakeString
- func (t *SnakeString) EnBase(base int) *SnakeString
- func (t *SnakeString) ExistHan() bool
- func (t *SnakeString) ExistSlice(dst []string) bool
- func (t *SnakeString) Extract(dst string, out ...string) []string
- func (t *SnakeString) Find(dst string, noreg ...bool) bool
- func (t *SnakeString) Get() string
- func (t *SnakeString) GetOneLine() string
- func (t *SnakeString) IsGBK() bool
- func (t *SnakeString) IsUTF8() bool
- func (t *SnakeString) KebabCase() *SnakeString
- func (t *SnakeString) Keep(dst string) *SnakeString
- func (t *SnakeString) LF() *SnakeString
- func (t *SnakeString) LcFirst() *SnakeString
- func (t *SnakeString) Lines() []string
- func (t *SnakeString) Ln(line ...int) *SnakeString
- func (t *SnakeString) MD5() string
- func (t *SnakeString) Narrow() *SnakeString
- func (t *SnakeString) ReComment() *SnakeString
- func (t *SnakeString) Remove(dst ...string) *SnakeString
- func (t *SnakeString) Replace(src, dst string, noreg ...bool) *SnakeString
- func (t *SnakeString) ReplaceOne(src, dst string) *SnakeString
- func (t *SnakeString) SnakeCase() *SnakeString
- func (t *SnakeString) Split(sep string) []string
- func (t *SnakeString) SplitInt(sep int) []string
- func (t *SnakeString) SplitPlace(sep []int) []string
- func (t *SnakeString) ToLower() *SnakeString
- func (t *SnakeString) ToUTF8() (string, bool)
- func (t *SnakeString) ToUpper() *SnakeString
- func (t *SnakeString) Trim(sep string) *SnakeString
- func (t *SnakeString) UcFirst() *SnakeString
- func (t *SnakeString) Unescape() string
- func (t *SnakeString) Widen() *SnakeString
- func (t *SnakeString) Write(dst string, add ...bool) bool
- type Tarlib
- type Ziplib
Constants ¶
This section is empty.
Variables ¶
var Len = utf8.RuneCountInString
Functions ¶
This section is empty.
Types ¶
type FileOperate ¶
type FileOperate interface { Get() *os.File String() *SnakeString Byte() []byte Close() error // 关闭文件链接 }
FileOperate ...
type FileSystem ¶
type FileSystem interface { Add(str ...string) FileSystem // 新增路径 ReplaceRoot(str ...string) FileSystem //替换根目录位置 Dir() string // 返回目录路径 Base() string // 返回路径中最后一个元素 IsDir(dst ...string) bool // 判断是否为目录 IsFile(dst ...string) bool // 判断是否为文件 Ls(opt ...string) []string // 查看文件夹列表 Find(opt ...string) []string // 查找文件 MkDir(dst ...string) bool // 新建文件夹 MkFile(dst ...string) (FileOperate, bool) // 新建文件 Write(src string, add ...bool) bool // 写入文件 ByteWriter(src []byte, add ...bool) (bool, error) // 通过Byte数组写入文件 Open(add ...bool) (FileOperate, bool) // 打开文件 Exist(dst ...string) bool // 判断目录或文件是否存在 Rm(dst ...string) bool // 删除目录或文件 Rn(newname string) bool // 修改目录或文件名 Mv(newpath string) bool // 移动目录或文件到指定位置 Cp(dir string, overwrite bool) bool // 拷贝目录或文件到指定位置 Ext() string // 返回文件扩展名 MimeTypes() string MD5() string // 返回文件MD5 SHA256() string // 返回文件SHA256 Config(conf interface{}) error // 加载配置文件 Get() string // 返回路径 Unzip() (string, error) }
FileSystem ...
type SnakeString ¶
type SnakeString struct {
Input string
}
func (*SnakeString) Add ¶
func (t *SnakeString) Add(str ...interface{}) *SnakeString
Add 在字符串中追加文字...
func (*SnakeString) AddSlice ¶
func (t *SnakeString) AddSlice(dts []interface{}) *SnakeString
AddSlice 通过Slice在字符串中追加文字...
func (*SnakeString) Between ¶
func (t *SnakeString) Between(start, end string) *SnakeString
Between 截取区间内容 ...
func (*SnakeString) CamelCase ¶
func (t *SnakeString) CamelCase() *SnakeString
CamelCase 驼峰分词: HelloWord ...
func (*SnakeString) Charset ¶
func (t *SnakeString) Charset() (string, bool)
Charset Function 返回当前进程的字符集 ...
func (*SnakeString) DeBase ¶
func (t *SnakeString) DeBase(base int) *SnakeString
DeBase Text Base-x to Text: 2 < base > 36 ... 将2~36进制解码为Text
func (*SnakeString) DrawBox ¶
func (t *SnakeString) DrawBox(width int, chars ...pkg.Box9Slice) *SnakeString
根据文字自动绘制代码提示框.
func (*SnakeString) EnBase ¶
func (t *SnakeString) EnBase(base int) *SnakeString
EnBase Text to Base-x: 2 < base > 36 ... 将Text转为2~36进制编码
func (*SnakeString) ExistSlice ¶
func (t *SnakeString) ExistSlice(dst []string) bool
ExistSlice 字符串是否存在于数组中 ...
func (*SnakeString) Extract ¶
func (t *SnakeString) Extract(dst string, out ...string) []string
Extract 根据正则规则提取字符数组 ...
func (*SnakeString) Find ¶
func (t *SnakeString) Find(dst string, noreg ...bool) bool
Find 判断字符串或符合正则规则的字符串是否存在 ...
func (*SnakeString) GetOneLine ¶
func (t *SnakeString) GetOneLine() string
GetOneLine 在多行字符串中获取第一行字符串...
func (*SnakeString) KebabCase ¶
func (t *SnakeString) KebabCase() *SnakeString
KebabCase "烤串儿"分词: hello-word ...
func (*SnakeString) Remove ¶
func (t *SnakeString) Remove(dst ...string) *SnakeString
Remove 根据正则规则删除字符串 ...
func (*SnakeString) Replace ¶
func (t *SnakeString) Replace(src, dst string, noreg ...bool) *SnakeString
Replace 替换字符串或符合正则规则的字符串 ... snake.Text("http://www.dedecms.com").Replace("(http://).*(dedecms.com)", "${1}${2}") out: http://dedecms.com snake.Text("http://www.example.com").Replace("example", "dedecms") out: http://www.dedecms.com 如需替换$等字符,请使用\\$ snake.Text("http://$1example.com").Replace("\\$1.*(.com)", "www.dedecms${1}")
func (*SnakeString) ReplaceOne ¶
func (t *SnakeString) ReplaceOne(src, dst string) *SnakeString
ReplaceOne 替换出现的第一个字符串 ...
func (*SnakeString) SnakeCase ¶
func (t *SnakeString) SnakeCase() *SnakeString
SnakeCase 贪吃蛇分词: hello_word ...
func (*SnakeString) SplitInt ¶
func (t *SnakeString) SplitInt(sep int) []string
SplitInt 根据设置对字符串等分 Text("abcdefg").SpltPlace([]int{1,3,4}) Out: []string{"a", "bc", "d", "efg"}
func (*SnakeString) SplitPlace ¶
func (t *SnakeString) SplitPlace(sep []int) []string
SplitPlace 根据字符串的位置进行分割 Text("abcdefg").SpltPlace([]int{1,3,4}) Out: []string{"a", "bc", "d", "efg"}
func (*SnakeString) ToUTF8 ¶
func (t *SnakeString) ToUTF8() (string, bool)
ToUTF8 Function 运行对当前进程进行编码转换成UTF-8 ...
func (*SnakeString) Trim ¶
func (t *SnakeString) Trim(sep string) *SnakeString
Trim 去除开始及结束出现的字符 ...
func (*SnakeString) Unescape ¶
func (t *SnakeString) Unescape() string