Quantcast
Channel: First steps - JuliaLang
Viewing all articles
Browse latest Browse all 2795

Any significant difference between string, *, and interpolation for concatenation?

$
0
0

I’m writing some training material, and I was wondering if there is any difference between the three methods for concatenation that I should be aware of?

The most easiest way to do it is:

greet = "Hello"
whom = "World"
println("$greet, $whom")

For new comers to Julia, is teaching the string() and * useful?

It seems if you’re putting 2 or 3 strings together using string() and * it shouldn’t be a problem. It may become difficult when you have a lot of variables, and need to piece together strings, punctuation and \n.

7 posts - 5 participants

Read full topic


Viewing all articles
Browse latest Browse all 2795

Latest Images

Trending Articles



Latest Images