mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
StringsBuilder => strings.Builder; strings.repeat()
This commit is contained in:
15
vlib/strings/builder_test.v
Normal file
15
vlib/strings/builder_test.v
Normal file
@ -0,0 +1,15 @@
|
||||
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'
|
||||
}
|
||||
|
Reference in New Issue
Block a user