xstrings

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: 0BSD Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package xstrings provides substring search and ECMAScript whitespace trimming for WTF-8 strings, and case mapping for valid UTF-8 strings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EndsWithCasedLetter

func EndsWithCasedLetter(s string, poll func()) bool

EndsWithCasedLetter reports whether s ends in a cased letter after ignoring trailing case-ignorable characters. poll is as for ToLowerCase.

func Index

func Index(s, sub wtf8.String, poll func()) int

Index returns the index of the first instance of sub in s, or -1, in time linear in the lengths of s and sub. poll, which may be nil, is called now and then during a long search, and may stop the search by panicking.

func IsWhiteSpaceOrLineTerminator

func IsWhiteSpaceOrLineTerminator(r rune) bool

IsWhiteSpaceOrLineTerminator reports whether r is WhiteSpace or LineTerminator.

func LastIndex

func LastIndex(s, sub wtf8.String, poll func()) int

LastIndex returns the index of the last instance of sub in s, or -1, in time linear in the lengths of s and sub. poll is as for Index.

func StartsWithCasedLetter

func StartsWithCasedLetter(s string, poll func()) bool

StartsWithCasedLetter reports whether s starts with a cased letter after ignoring leading case-ignorable characters. poll is as for ToLowerCase.

func ToLowerCase

func ToLowerCase(s string, start, end int, poll func()) string

ToLowerCase maps s[start:end] to full default lowercase in the context of s. s must be valid UTF-8 and both offsets must be rune boundaries. A non-nil poll may interrupt a long mapping.

func ToUpperCase

func ToUpperCase(s string) string

ToUpperCase returns the full default uppercase mapping of a valid UTF-8 string.

func TrimWhiteSpace

func TrimWhiteSpace(s wtf8.String, start, end bool) wtf8.String

TrimWhiteSpace implements TrimString. start and end select the sides to trim.

Types

This section is empty.

Jump to

Keyboard shortcuts

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