Initial Commit

This commit is contained in:
MarcusTL12
2019-09-12 16:32:16 +02:00
parent 3eff6439e4
commit 4adc9cd975
20 changed files with 1151 additions and 0 deletions

15
Code/14.IOBuffer.jl Normal file
View File

@@ -0,0 +1,15 @@
# IOBuffers are like writing to a file in memory. They are really efficient
# when creating strings and work like any other IO object we've worked with.
io = IOBuffer()
a = 42
write(io, "i = ")
print(io, a)
# To retrieve the written data from the buffer we call take!(). This returns
# a Vector{UInt8} so to interpret it as a string we call String()
s = String(take!(io))
println(s)