If I try to do the following
i=["string"]
for j in i
if i == i[j]
print(i[j])
end
end
it says I'm using a string as an index. How do I test if a string is in array?
julia> i = ["string1", "string2"]
2-element Vector{String}:
"string1"
"string2"
julia> "string1" in i
true
julia> "string3" in i
false
Ok, thanks!
Last updated: Nov 06 2024 at 04:40 UTC