1
0
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:
Alexander Medvednikov
2019-07-03 22:11:27 +02:00
parent e35ff0533b
commit 5d4d3b838b
10 changed files with 61 additions and 30 deletions

View 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'
}