stringutils

package
v8.1.3+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlphaDigitize

func AlphaDigitize(r rune) rune

AlphaDigitize replaces non-letter, non-digit, non-underscore characters with underscore.

func BaseName

func BaseName(name string) string

BaseName the last path element of a slash-delimited name, with the last dotted suffix removed.

func CamelCase

func CamelCase(s string) string

CamelCase converts a string from snake_case to CamelCased.

If there is an interior underscore followed by a lower case letter, drop the underscore and convert the letter to upper case. There is a remote possibility of this rewrite causing a name collision, but it's so remote we're prepared to pretend it's nonexistent - since the C++ generator lowercases names, it's extremely unlikely to have two fields with different capitalizations. In short, _my_field_name_2 becomes XMyFieldName_2.

func CamelCaseSlice

func CamelCaseSlice(elem []string) string

CamelCaseSlice is like CamelCase, but the argument is a slice of strings to be joined with "_" and then camelcased.

func CleanIdentifier

func CleanIdentifier(s string) string

CleanIdentifier makes sure s is a valid 'identifier' string: it contains only letters, numbers, and underscore.

func DotJoin

func DotJoin(elem []string) string

DotJoin joins a slice of strings with '.'

func SnakeCase

func SnakeCase(s string) string

SnakeCase converts a string from CamelCase to snake_case.

Types

This section is empty.

Jump to

Keyboard shortcuts

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