What is the simplest way in Julia to concatenate a string and an integer value? I would like to do something like:
julia> foo = "test: " "test: " julia> bar = 3 3 julia> foobar = foo * bar ERROR: `*` has no method matching *(::ASCIIString, ::Int64)
Using '*' operator It is used to concatenate different strings and/or characters into a single string. We can concatenate two or more strings in Julia using * operator.
CSS performs concatenation without using any operator (e.g. +, &, etc). Keep your strings in quotes combine the strings, attr, var, etc into one line. Examples: url('not/very' '/useful/concatenation'); // not/very/useful/concatentation.
Concatenation is the process of appending one string to the end of another string. You concatenate strings by using the + operator. For string literals and string constants, concatenation occurs at compile time; no run-time concatenation occurs.
I'm not terribly familar with Julia, but I believe you'd be better off with string interpolation:
"test: $bar"
Or alternately:
string("test: ", bar)
Or, if you did want to use the *
operator, I believe you'd want:
"test: " * string(bar)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With