mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
strings: add Builder.write_rune/1 and Builder.write_runes/1 methods
This commit is contained in:
parent
26b77515b9
commit
fe08e1c504
3 changed files with 46 additions and 7 deletions
|
@ -34,9 +34,7 @@ pub fn (c rune) str() string {
|
|||
[manualfree]
|
||||
pub fn (ra []rune) string() string {
|
||||
mut sb := strings.new_builder(ra.len)
|
||||
for r in ra {
|
||||
sb.write_string(r.str())
|
||||
}
|
||||
sb.write_runes(ra)
|
||||
res := sb.str()
|
||||
unsafe { sb.free() }
|
||||
return res
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue