format

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2022 License: MIT Imports: 6 Imported by: 1

Documentation

Overview

Package format implements various formatting functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCaseToUnderscore added in v1.0.40

func CamelCaseToUnderscore(s string) string

CamelCaseToUnderscore returns camel case string s in underscore style. For example: FooBar -> foo_bar

func LeftPaddingWithSize added in v1.0.36

func LeftPaddingWithSize(l int, s string, ch string) string

LeftPaddingWithSize pads the string s with enough of character ch to the length l. For example: LeftPaddingWithSize(10, "hello", "*") will produce the string "*****hello"

func PadZeroToNineWithZero added in v1.0.30

func PadZeroToNineWithZero(i int) string

PadZeroToNineWithZero pad i with '0' in front. For example: '0' => '00', '1' => '01' ... '9' => '09'

func RightPaddingWithSize added in v1.0.36

func RightPaddingWithSize(l int, s string, ch string) string

RightPaddingWithSize pads the string s with enough of character ch to the length l. For example: RightPaddingWithSize(10, "hello", "*") will produce the string "hello*****"

func UnderscoreToLowerCamelCase added in v1.0.40

func UnderscoreToLowerCamelCase(s string, t language.Tag) string

UnderscoreToLowerCamelCase returns underscore string s in language t in lower camel case. For example: foo_bar -> fooBar

func UnderscoreToUpperCamelCase added in v1.0.40

func UnderscoreToUpperCamelCase(s string, t language.Tag) string

UnderscoreToUpperCamelCase returns underscore string s in language t in upper camel case. For example: foo_bar -> FooBar

Types

This section is empty.

Jump to

Keyboard shortcuts

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