strings

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package strings defines strings helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CaesarDecrypt

func CaesarDecrypt(input string, shift int) string

CaesarDecrypt decrypts a string encrypted with the Caesar cipher and a given shift.

func CaesarEncrypt

func CaesarEncrypt(input string, shift int) string

CaesarEncrypt encrypts a string using the Caesar cipher with a given shift.

func IsValidEmail

func IsValidEmail(email string) bool

IsValidEmail checks if a given string is a valid email address.

func Rot13Decode

func Rot13Decode(input string) string

Rot13Decode decodes a string encoded with the ROT13 cipher.

func Rot13Encode

func Rot13Encode(input string) string

Rot13Encode encodes a string using the ROT13 cipher.

func SanitizeEmail

func SanitizeEmail(email string) string

SanitizeEmail removes leading and trailing whitespace from an email address.

func SubstringSearch

func SubstringSearch(input, substring string, options SubstringSearchOptions) []string

SubstringSearch performs substring search in a string and optionally returns indexes.

func Title

func Title(input string) string

Title return string in title case with English language-specific title

func ToTitle

func ToTitle(input string, exceptions []string) string

ToTitle converts a string to title case, capitalizing the first letter of each word. It excludes exceptions specified in the exceptions slice.

func Tokenize

func Tokenize(input string, customDelimiters string) []string

Tokenize splits a given string into words based on whitespace and custom delimiters.

Types

type SubstringSearchOptions

type SubstringSearchOptions struct {
	CaseInsensitive bool // Perform case-insensitive search
	ReturnIndexes   bool // Return the starting indexes of found substrings
}

SubstringSearchOptions contains options for substring search.

Jump to

Keyboard shortcuts

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