Documentation
¶
Overview ¶
Copyright © 2023 Xu Wu <ixw1991@126.com> Use of this source code is governed by a MIT style license that can be found in the LICENSE file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SkipFirstAndLastParts ¶
SkipFirstAndLastParts 去掉输入字符串的第一部分和最后一部分, 如果只有一个 '-',则只去掉第一部分。 例如,"hello-world-golang" 转换为 "world", "hello-world" 转换为 "world", "hello" 保持不变。
func SkipFirstPart ¶
SkipFirstPart 函数用于跳过以 "-" 分隔的字符串的第一部分 如果输入的字符串s包含 "-",例如:"hello-world-android",函数会跳过第一个 "-" 之前的部分(即"hello"),并返回剩余部分转换为驼峰命名的字符串,如:"worldAndroid" 如果输入的字符串s不包含 "-",函数会原样返回输入的字符串s
func SkipLastPart ¶
SkipLastPart 函数跳过以 '-' 分隔的字符串的最后一部分 例如,"hello-world-android" 转换为 "hello-world" 如果字符串没有 '-',例如 "tope",则返回原字符串
func StringInSlice ¶
StringInSlice 函数检查字符串 a 是否在列表 list 中
func ToCamelCase ¶
ToCamelCase 函数将一个由'-'连接的字符串转换为 camelCase 例如,"hello-world" 转换为 "helloWorld"
func ToPascalCase ¶
ToPascalCase 函数将一个由'-'连接的字符串转换为 PascalCase 例如,"hello-world" 转换为 "HelloWorld"
Types ¶
This section is empty.