strings

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package strings provides string manipulation utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(s, substr string) bool

Contains checks if a string contains a substring.

func HasPrefix

func HasPrefix(s, prefix string) bool

HasPrefix checks if a string has the given prefix.

func HasSuffix

func HasSuffix(s, suffix string) bool

HasSuffix checks if a string has the given suffix.

func Join

func Join(parts []string, sep string) string

Join joins a slice of strings with a separator.

func Repeat

func Repeat(s string, count int) string

Repeat repeats a string n times.

func Replace

func Replace(s, old, new string, n int) string

Replace replaces occurrences of old with new in s. n is the number of replacements: -1 means replace all.

func Split

func Split(s, sep string) []string

Split splits a string by a separator and returns a slice of parts.

func ToLower

func ToLower(s string) string

ToLower converts a string to lowercase.

func ToUpper

func ToUpper(s string) string

ToUpper converts a string to uppercase.

func Trim

func Trim(s string) string

Trim removes leading and trailing whitespace from a string.

func TrimLeft

func TrimLeft(s string) string

TrimLeft removes leading whitespace from a string.

func TrimRight

func TrimRight(s string) string

TrimRight removes trailing whitespace from a string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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