strutil

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 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 IsDigitString added in v1.0.0

func IsDigitString(s string) bool

IsDigitString checks if a string only contains 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 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