julia> s = "abcdefg"
"abcdefg"
julia> s1 = s[3:4]
"cd"
julia> s2 = match(r"c.", s).match
"cd"
julia> typeof(s)
String
julia> typeof(s1)
String
julia> typeof(s2)
SubString{String}
What functionality does SubString enable? It looks like a container. If so, what other types can it hold? If this is useful, why isn't s1 a SubString?
I found this behavior strange when I had to convert s2 into a pure String to get it into a f(x::String) function. What is the difference between using String(s2) and string(s2) for that conversion?