Len() -> RuneLength()

master
Charles Iliya Krempeaux 2022-07-18 18:46:19 -07:00
parent 2129573f6d
commit 164657caf8
1 changed files with 6 additions and 6 deletions

View File

@ -1,31 +1,31 @@
package utf8
// Len returns the number of bytes in a UTF-8 encoding of this Unicode code point.
// RuneLength returns the number of bytes in a UTF-8 encoding of this Unicode code point.
//
// Example
//
// length := utf8.Len('A')
// length := utf8.RuneLength('A')
//
// // length == 1
//
// Example
//
// length := utf8.Len('r')
// length := utf8.RuneLength('r')
//
// // length == 1
//
// Example
//
// length := utf8.Len('¡')
// length := utf8.RuneLength('¡')
//
// // length == 2
//
// Example
//
// length := utf8.Len('۵')
// length := utf8.RuneLength('۵')
//
// // length == 2
func Len(r rune) int {
func RuneLength(r rune) int {
switch {
case 127 >= r: