ss

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 22, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capitalize

func Capitalize(s string) string

Capitalize changes first rune to uppercase

func DeleteWhitespaces

func DeleteWhitespaces(s string) string

DeleteWhitespaces deletes all whitespaces (unicode.IsSpace) in string.

func IndentLines

func IndentLines(v string, spaces int) string

func IndentLinesFull

func IndentLinesFull(v string, spaces int) string

func IsBlank

func IsBlank(s string) bool

IsBlank returns whether a string is whitespace or empty.

func PadCenter

func PadCenter(str string, length int, pad string) string

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

func PadLeft(str string, length int, pad string) string

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

func PadRight(str string, length int, pad string) string

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

func SplitLowerWords(str string) []string

SplitLowerWords splits words with "-", "_", ".", whitespaces

func StringAfter

func StringAfter(str string, find string) string

func StringAfterLast

func StringAfterLast(str string, find string) string

func StringBefore

func StringBefore(str string, find string) string

func StringBeforeLast

func StringBeforeLast(str string, find string) string

func StringBetween

func StringBetween(str string, begin string, end string) string

func ToCamelcase

func ToCamelcase(str string) string

ToCamelcase can convert all words in a string to camel format.

Some samples.

"Hello world"  => "helloWorld"
"Hello-world"  => "helloWorld"
"Hello_world"  => "helloWorld"

func ToDashizerName

func ToDashizerName(str string) string

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

func ToPropertyName(str string) string

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

func ToUnderlineName(str string) string

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 TrimPrefixStringList(values []string, prefix string) []string

func TrimSpaceStringList

func TrimSpaceStringList(values []string) []string

func TrimSuffixStringList

func TrimSuffixStringList(values []string, suffix string) []string

func Uncapitalize

func Uncapitalize(s string) string

Capitalize changes first rune to lowercase

func UnquoteString

func UnquoteString(s string) string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL