casefold

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 3 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 casefold 提供与 bytes.ToLower 逐字节一致的小写转换。

标准库对含非 ASCII 字符的输入逐字符查询 Unicode 大小写表。中日韩文字没有 大小写,却占据此类页面的大部分字符;这里按码位区间直接跳过它们,ASCII 连续段整段复制后原地转换,其余字符仍交给 unicode.ToLower。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lower

func Lower(src []byte) []byte

Lower 返回 src 的小写形式,内容与 bytes.ToLower(src) 逐字节相同: 非法 UTF-8 字节替换为 U+FFFD。无需改写时直接返回 src,不复制; 调用方必须把输入和返回值都视为只读。

func LowerString

func LowerString(src []byte) string

LowerString 与 Lower 相同,但把结果作为字符串返回且不再复制。 无需改写时字符串与 src 共用底层数组,src 在字符串存活期间不得修改。

Types

This section is empty.

Jump to

Keyboard shortcuts

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