mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
16 lines
249 B
V
16 lines
249 B
V
|
import strings
|
||
|
|
||
|
fn test_sb() {
|
||
|
mut sb := strings.Builder{}
|
||
|
sb.write('hi')
|
||
|
sb.write('!')
|
||
|
sb.write('hello')
|
||
|
assert sb.str() == 'hi!hello'
|
||
|
sb = strings.new_builder(10)
|
||
|
sb.write('a')
|
||
|
sb.write('b')
|
||
|
println(sb.str())
|
||
|
assert sb.str() == 'ab'
|
||
|
}
|
||
|
|