Code
1.HelloWorld.jl
10.structs1.jl
11.structs2.jl
12.structs3.jl
13.fileIO.jl
14.IOBuffer.jl
15.lambdas.jl
16.Macro.jl
17.Broadcast.jl
18.Unicode.jl
19.Packages.txt
2.functions.jl
3.arithmetic.jl
4.strings.jl
5.arrays.jl
6.dicts.jl
7.sets.jl
8.controllflow.jl
9.scopes.jl
LiveCode
.gitignore
README.md
16 lines
388 B
Julia
16 lines
388 B
Julia
|
|
# 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)
|
|
|