strutil

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 2 Imported by: 2

Documentation

Overview

Package strutil implements some string utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Camelize added in v1.5.0

func Camelize(s string, upper bool) string

Camelize converts an ASCII string to camel case like string, and supports specifying the case of the first letter.

func IsDigitString added in v1.0.0

func IsDigitString(s string) bool

IsDigitString checks if a string only contains ASCII digits.

func ShellEscape added in v0.0.5

func ShellEscape(s string) string

ShellEscape escapes a string for use in a shell command.

func ShellEscapeExceptTilde added in v0.0.5

func ShellEscapeExceptTilde(s string) string

ShellEscapeExceptTilde escapes a string for use in a shell command, except '~'.

func SliceContain

func SliceContain(slice []string, value string) bool

SliceContain determines whether a string slice includes a certain value.

func Underscore added in v1.5.0

func Underscore(s string, upper bool) string

Underscore converts an ASCII string to snake case like string, and supports specifying the case of all letters.

func UnsafeBytesToString added in v1.2.0

func UnsafeBytesToString(b []byte) string

UnsafeBytesToString converts byte slice to string without allocation. The bytes passed to function must not be modified afterwards.

func UnsafeStringToBytes added in v1.2.0

func UnsafeStringToBytes(s string) []byte

UnsafeStringToBytes converts string to byte slice without allocation.

Types

This section is empty.

Jump to

Keyboard shortcuts

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