length

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lines

func Lines(s string) []string

Lines breaks a string apart into lines; a final newline in the string does not add a blank final line, but two or more final newlines will add one-less-than-count blank lines.

func LongestLineBytes

func LongestLineBytes(s string) int

LongestLineBytes returns the length of the longest virtual line in a string containing embedded newlines, measuring length per StringBytes.

func LongestLineCells

func LongestLineCells(s string) int

LongestLineCells returns the length of the longest virtual line in a string containing embedded newlines, measuring length per StringCells.

func LongestLineRunes

func LongestLineRunes(s string) int

LongestLineRunes returns the length of the longest virtual line in a string containing embedded newlines, measuring length per StringRunes.

func StringBytes

func StringBytes(s string) int

StringBytes is the number of bytes in a string

func StringCells

func StringCells(s string) int

StringCells is an attempt to guess the number of display cells in a fixed-grid terminal window system of cells required for the characters in the string.

It does handle full-width and combining, but doesn't handle wide emojis (at this time).

The implementation of this function is subject to change as we try to get closer.

func StringRunes

func StringRunes(s string) int

StringRunes is the number of runes in 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