Documentation
¶
Index ¶
- func Capitalize(s string) string
- func DeleteWhitespaces(s string) string
- func IndentLines(v string, spaces int) string
- func IndentLinesFull(v string, spaces int) string
- func IsBlank(s string) bool
- func PadCenter(str string, length int, pad string) string
- func PadLeft(str string, length int, pad string) string
- func PadRight(str string, length int, pad string) string
- func SplitLowerWords(str string) []string
- func StringAfter(str string, find string) string
- func StringAfterLast(str string, find string) string
- func StringBefore(str string, find string) string
- func StringBeforeLast(str string, find string) string
- func StringBetween(str string, begin string, end string) string
- func ToCamelcase(str string) string
- func ToDashizerName(str string) string
- func ToPropertyName(str string) string
- func ToUnderlineName(str string) string
- func TrimPrefixStringList(values []string, prefix string) []string
- func TrimSpaceStringList(values []string) []string
- func TrimSuffixStringList(values []string, suffix string) []string
- func Uncapitalize(s string) string
- func UnquoteString(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteWhitespaces ¶
DeleteWhitespaces deletes all whitespaces (unicode.IsSpace) in string.
func IndentLines ¶
func IndentLinesFull ¶
func PadCenter ¶
PadCenter returns a string with pad string at both side if str's rune length is smaller than length. If str's rune length is larger than length, str itself will be returned.
If pad is an empty string, str will be returned.
Samples:
PadCenter("hello", 4, " ") => "hello" PadCenter("hello", 10, " ") => " hello " PadCenter("hello", 10, "123") => "12hello123"
func PadLeft ¶
PadLeft returns a string with pad string at right side if str's rune length is smaller than length. If str's rune length is larger than length, str itself will be returned.
If pad is an empty string, str will be returned.
Samples:
PadLeft("hello", 4, " ") => "hello" PadLeft("hello", 10, " ") => "hello " PadLeft("hello", 10, "123") => "hello12312"
func PadRight ¶
PadRight returns a string with pad string at left side if str's rune length is smaller than length. If str's rune length is larger than length, str itself will be returned.
If pad is an empty string, str will be returned.
Samples:
PadRight("hello", 4, " ") => "hello" PadRight("hello", 10, " ") => " hello" PadRight("hello", 10, "123") => "12312hello"
func SplitLowerWords ¶
SplitLowerWords splits words with "-", "_", ".", whitespaces
func StringAfter ¶
func StringAfterLast ¶
func StringBefore ¶
func StringBeforeLast ¶
func ToCamelcase ¶
ToCamelcase can convert all words in a string to camel format.
Some samples.
"Hello world" => "helloWorld" "Hello-world" => "helloWorld" "Hello_world" => "helloWorld"
func ToDashizerName ¶
ToDashizeName can convert all words in a string to dashizer format.
Some samples.
"HelloWorld" => "hello-world" "Hello World" => "hello-world" "Hello-World" => "hello-world" "Hello_World" => "hello-world"
func ToPropertyName ¶
ToPropertyName can convert all words in a string to point format.
Some samples.
"HelloWorld" => "hello.world" "Hello World" => "hello.world" "Hello-World" => "hello.world" "Hello_World" => "hello.world"
func ToUnderlineName ¶
ToUnderlineName can convert all words in a string to underscore format.
Some samples.
"HelloWorld" => "hello_world" "Hello World" => "hello_world" "Hello-World" => "hello_world" "Hello_World" => "hello_world"
func TrimPrefixStringList ¶
func TrimSpaceStringList ¶
func TrimSuffixStringList ¶
func UnquoteString ¶
Types ¶
This section is empty.