stringutils

package module
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsRune added in v0.0.4

func ContainsRune(str string, match rune) bool

Does string contain match and is match not escaped

func HasUnescapedPrefix added in v0.0.4

func HasUnescapedPrefix(str string, target rune) bool

Checks if str starts with target rune and it is not escaped by `\`

func IsEnclosedByAndUnescaped added in v0.0.4

func IsEnclosedByAndUnescaped(str string, charA, charB rune) bool

Checks if str starts with charA and ends with charB (and are unescaped)

func IsEscaped

func IsEscaped(str string, char rune) bool

Checks if every occurrence of `char` in `str` is escaped by `\`

func IsLogicalRuneEscaped added in v0.0.7

func IsLogicalRuneEscaped(str string, logicalPos int) bool

Checks escape status using logical index (backslashes do not contribute to index)

func IsRuneEscaped added in v0.0.4

func IsRuneEscaped(str string, pos int) bool

Checks if the rune at index `pos` in `str` is escaped by a single backslash

func ToArray

func ToArray(sliceStr string) []string

Helper method for converting a (!unescaped) comma-separated string into string slices

func ToType

func ToType(str string) any

String to type conversion, converts typed strings into respective type

func UnescapeAll added in v0.0.4

func UnescapeAll(str string) string

Removes single backslash escapes from the entire string (`\a` => `a`, `\\a` => `\a`)

func UnescapeRune added in v0.0.4

func UnescapeRune(str string, target rune) string

Removes the escaping backslash for a specific rune in the string

Types

This section is empty.

Jump to

Keyboard shortcuts

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