Concatenation of strings not working inside a function

The simple function of concatenating strings does not seem to be working. I tried this simplest of codes on v1.1.0.

function f(name::String) :: String
return String(name, “_GaussKer”);
end
julia> s = f(“test”)
ERROR: MethodError: no method matching String(::String, ::String)
Closest candidates are:

Do you know what is happening ?

For concatenation, you want string (or the * operator), not String.

3 Likes

string lowercase is a function (like println)
String uppercase is a type (like Float64)

2 Likes

Thank you for the clarification. It is really helpful.