str
Builtin index · Collections & strings
result = str(x)
Input: x · Output: result
What it is
Renders x (any value/type) the same way print/disp would.
Overloads
One call shape — this function is not overloaded.
| Code | Input | Output | Description |
result = str(x) | x Strnot documented yet
| result Str
| Returns a Str. |
Examples
From the documentation, and run by the build -- the output and the figure below are what the engine actually produced. Simplest first.
x = 1:10
print("sum = " + str(sum(x)))
write_report("summary.html")
print(file_exists("summary.html")) # true
from file-io
df = table(a = randn(30, seed = 3), b = randn(30, seed = 4), c = randn(30, seed = 5))
eda(df) # correlation heatmap + one histogram per numeric column, auto-gridded
print("columns: " + str(cols(df)))
from plotting
f = fopen("log.txt", "w")
write_line(f, "run started")
write_line(f, "value = " + str(42))
close(f)
print(file_size("log.txt")) # 23 -- "run started\n" + "value = 42\n"
from file-io
m = randn(10, 10, seed = 4)
heatmap(m, colormap="viridis")
colorbar
title("Random field")
print("value range: [" + str(min(m)) + ", " + str(max(m)) + "]")
outputvalue range: [-2.270955, 2.7556]
from plotting