strutil

package
v0.16.4 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package strutil is used only for naming package, variable, etc inside the go template.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToCamel

func ToCamel(s string) string

ToCamel tranforms s into camelCase and remove non-alphanumeric characters.

func ToLetterPrefix

func ToLetterPrefix(s string) string

ToLetterPrefix transform s when s is prefixed with non-letter character, e.g. 1Partcarbon -> Z_1Partcarbon

func ToLower

func ToLower(s string) string

ToLower tranforms s into lowercase and remove non-alphanumeric characters.

func ToNonGoIdent

func ToNonGoIdent(s string) string

ToNonGoIdent transform s when s is equal with go identifier, e.g. switch -> switch_z

func ToSnake

func ToSnake(s string) string

ToSnake tranforms s into snake_case and replace non-alphanumeric characters with underscore '_'

func ToTitle

func ToTitle(s string) string

ToTitle tranforms s into TitleCase and remove non-alphanumeric characters.

func TrimRepeatedChar

func TrimRepeatedChar(s string, char rune) string

TrimRepeatedChar trim repeated given char in any position in the s. e.g. (s: "a,,b,,,c", char: ',') -> a,b,c

Types

This section is empty.

Jump to

Keyboard shortcuts

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