mirror of
https://github.com/vlang/v.git
synced 2025-09-15 23:42:28 +03:00
all: add strings.Builder.write_string and use write_string instead of write (#8892)
This commit is contained in:
parent
36a6bc270c
commit
f54c1a5cc2
34 changed files with 402 additions and 397 deletions
|
@ -4,12 +4,12 @@ import strings
|
|||
|
||||
fn generate_temp_html() string {
|
||||
mut temp_html := strings.new_builder(200)
|
||||
temp_html.write('<!doctype html><html><head><title>Giant String</title></head><body>')
|
||||
temp_html.write_string('<!doctype html><html><head><title>Giant String</title></head><body>')
|
||||
for counter := 0; counter < 4; counter++ {
|
||||
temp_html.write("<div id='name_$counter' ")
|
||||
temp_html.write("class='several-$counter'>Look at $counter</div>")
|
||||
temp_html.write_string("<div id='name_$counter' ")
|
||||
temp_html.write_string("class='several-$counter'>Look at $counter</div>")
|
||||
}
|
||||
temp_html.write('</body></html>')
|
||||
temp_html.write_string('</body></html>')
|
||||
return temp_html.str()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue