packages / string
package

string

import "string"

Package string provides operations on byte-slice strings.

Index

Functions 3

pub fn cmp(a []byte, b []byte) i64

cmp compares a and b lexicographically using unsigned byte values. It returns -1 when a precedes b, 0 when they are equal, and 1 when a follows b. If one string is a prefix of the other, the shorter precedes the longer. Zero bytes are compared normally, rather than terminating the string. Comparison does not depend on locale or Unicode encoding.

string.bos:9 #cmp
pub fn eq(a []byte, b []byte) bool

eq reports whether a and b contain the same bytes.

string.bos:20 #eq
pub fn copy(out []mut byte, src []byte) []byte

copy copies as much of src into out as fits and returns the written prefix.

string.bos:32 #copy