builtin: fix comment examples in int.v (#7902)

pull/7929/head
Larpon 2021-01-06 19:02:04 +01:00 committed by GitHub
parent 9025c3528f
commit dcc8310bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -439,11 +439,13 @@ pub fn (nn voidptr) hex_full() string { return u64_to_hex(nn, 16) }
pub fn (nn byteptr) hex_full() string { return u64_to_hex(nn, 16) }
*/
// str returns the contents of `byte` as a zero terminated `string`.
// Example: assert byte(111).str() == 'o'
// Example: assert byte(111).str() == '111'
pub fn (b byte) str() string {
return int(b).str_l(7)
}
// ascii_str returns the contents of `byte` as a zero terminated ASCII `string` character.
// Example: assert byte(97).ascii_str() == 'a'
pub fn (b byte) ascii_str() string {
mut str := string{
str: malloc(2)