# Wrap a string with spaces between quotes
if (isa(arg, AbstractString) || isa(arg, Symbol))
out = string(arg)
if (occursin(" ", out))
out = "\"" * out * "\""
It works well when the input has blanks
julia> f("aaa bbb")
nothing when it doesn’t
What are you
occursin expecting to do?
It returns true/false depending on weather the the first argument is contained in the second.
In your second call that condition is not met and
if block is not executed.
There is no return statement.
occursin == true then the implicit return value is
out (it is the last line executed except for
occursin == false then there is no assignment as the last line. It is the
if statement. Then
nothing is returned instead.
I suggest adding a
return out at the end.
You are right, but I was expecting that when
occursin == false the previous assignment (
out = string(arg) was the last one and that value should be the return value