strutils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2020 License: BSD-2-Clause Imports: 0 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsRuneBoundary

func IsRuneBoundary(s string, index int) bool

IsRuneBoundary checks that `index`-th byte is the first byte in a UTF-8 code point sequence or the end of the string.

The start and end of the string (when `index == len(s)`) are considered to be boundaries.

Returns `false` if `index` is greater than `len(s)`.

Examples

``` ```

Types

type ByteOffsets

type ByteOffsets struct {
	// Start byte position, inclusive.
	Start int
	// End byte position, exclusive.
	End int
}

ByteOffsets represents a (start, end) range of byte offset positions.

type BytesToRuneOffsetConverter

type BytesToRuneOffsetConverter struct {
	// contains filtered or unexported fields
}

func NewBytesToRuneOffsetConverter

func NewBytesToRuneOffsetConverter(sequence string) *BytesToRuneOffsetConverter

func (*BytesToRuneOffsetConverter) Convert

type RuneOffsets

type RuneOffsets struct {
	// Start rune position, inclusive.
	Start int
	// End rune position, exclusive.
	End int
}

RuneOffsets represents a (start, end) range of byte rune positions.

Jump to

Keyboard shortcuts

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