By using ‘$’, you can evaluate an expression inside string
literal.
julia> message="Welcome";name="Hari"; julia> info="$message,$name" "Welcome,Hari" julia> data="1+2=$(1+2)"; julia> data "1+2=3"
To include $ in string literal, you have to use \.
julia> message="Today revenue is \$100"; julia> print(message) Today revenue is $100
No comments:
Post a Comment