added more docs
parent
50a81feeba
commit
9acec1ea30
24
len.go
24
len.go
|
@ -1,6 +1,30 @@
|
||||||
package utf8s
|
package utf8s
|
||||||
|
|
||||||
// Len returns the number of bytes in a UTF-8 encoding of this Unicode code point.
|
// Len returns the number of bytes in a UTF-8 encoding of this Unicode code point.
|
||||||
|
//
|
||||||
|
// Example
|
||||||
|
//
|
||||||
|
// length := utf8s.Len('A')
|
||||||
|
//
|
||||||
|
// // length == 1
|
||||||
|
//
|
||||||
|
// Example
|
||||||
|
//
|
||||||
|
// length := utf8s.Len('r')
|
||||||
|
//
|
||||||
|
// // length == 1
|
||||||
|
//
|
||||||
|
// Example
|
||||||
|
//
|
||||||
|
// length := utf8s.Len('¡')
|
||||||
|
//
|
||||||
|
// // length == 2
|
||||||
|
//
|
||||||
|
// Example
|
||||||
|
//
|
||||||
|
// length := utf8s.Len('۵')
|
||||||
|
//
|
||||||
|
// // length == 2
|
||||||
func Len(r rune) int {
|
func Len(r rune) int {
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
|
|
Loading…
Reference in New Issue