iostream.blob.writestring
Writes the string and returns the number of characters written
Parameters
str | string | the string to write |
Return value
See iostream.stream.writestring for the generic contract.
Notes
Writing past the current len grows this blob to fit, the same as writen.
Example
from "iostream" import blob
let b = blob(0) // empty: writing to it must grow it
println("b.writestring(\"hi\") =", b.writestring("hi"))
println("b.len() =", b.len())
println("b.as_string() =", b.as_string())Output:
b.writestring("hi") = 2
b.len() = 2
b.as_string() = hiSee also
writestring | Writes the string and returns the number of characters written |
writeblob | Writes the given blob and returns the number of bytes written |
as_string | Returns the blob contents as a string |
| blob | class index |