strutil

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package strutil contains various string manipulation utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CamelCase

func CamelCase(s string) string

CamelCase converts a string to camel case.

func KebabCase

func KebabCase(s string) string

KebabCase converts a string to kebab case.

func Pad

func Pad(s string, n int, p string) string

Pad returns a string of length n that is centered and filled with the string p. If the length of s is already greater than or equal to n, the original string is returned. If n is negative, behavior is undefined. If an odd number of padding characters is required, the extra characters are added to the left.

func PadLeft

func PadLeft(s string, n int, p string) string

PadLeft returns a string of length n that is filled with the string p on the left. If the length of s is already greater than or equal to n, the original string is returned. If n is negative, behavior is undefined.

func PadRight

func PadRight(s string, n int, p string) string

PadRight returns a string of length n that is filled with the string p on the right. If the length of s is already greater than or equal to n, the original string is returned. If n is negative, behavior is undefined.

func SnakeCase

func SnakeCase(s string) string

SnakeCase converts a string to snake case.

func Truncate

func Truncate(s string, n int) string

Truncate returns a string of length n.

Types

This section is empty.

Jump to

Keyboard shortcuts

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