Tutorial by Examples

Strings in Julia are delimited using the " symbol: julia> mystring = "Hello, World!" "Hello, World!" Note that unlike some other languages, the ' symbol cannot be used instead. ' defines a character literal; this is a Char data type and will only store a single Unico...
Julia's Char type represents a Unicode scalar value, which only in some cases corresponds to what humans perceive as a "character". For instance, one representation of the character é, as in résumé, is actually a combination of two Unicode scalar values: julia> collect("é&quot...
There are numerous ways to convert numeric types to strings in Julia: julia> a = 123 123 julia> string(a) "123" julia> println(a) 123 The string() function can also take more arguments: julia> string(a, "b") "123b" You can also insert (aka ...
In Julia, as in many other languages, it is possible to interpolate by inserting values defined by variables into strings. For a simple example: n = 2 julia> MyString = "there are $n ducks" "there are 2 ducks" We can use other types than numeric, e.g. Result = false j...
Strings can be made from functions that work with IO objects by using the sprint function. For instance, the code_llvm function accepts an IO object as the first argument. Typically, it is used like julia> code_llvm(STDOUT, *, (Int, Int)) define i64 @"jlsys_*_46115"(i64, i64) #0 { ...

Page 1 of 1