mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
builtin: add a rune.bytes() convenience method (#13129)
This commit is contained in:
@@ -54,6 +54,10 @@ pub fn (c rune) repeat(count int) string {
|
||||
return res.repeat(count)
|
||||
}
|
||||
|
||||
pub fn (c rune) bytes() []byte {
|
||||
return c.str().bytes()
|
||||
}
|
||||
|
||||
pub fn (c rune) length_in_bytes() int {
|
||||
code := u32(c)
|
||||
if code <= 0x7F {
|
||||
|
Reference in New Issue
Block a user