You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because they're implemented in terms of iterate, they already work on InlineString types but they return a SubString whereas, like with chop/chomp, we could instead be returning an InlineString e.g.
julia> s ="hey_there_";
julia> si =InlineString(s);
julia>chopsuffix(s, "_")
"hey_there"
julia>chopsuffix(si, "_") # correct answer, but..."hey_there"
julia>typeof(ans) # unexpected type (SubString)
SubString{String15}
julia>chop(si) # for comparison..."hey_there"
julia>typeof(ans) # returns InlineString (not SubString)
String15
In Julia v1.8 we now have
chopprefix
andchopsuffix
Because they're implemented in terms of
iterate
, they already work on InlineString types but they return aSubString
whereas, like withchop
/chomp
, we could instead be returning anInlineString
e.g.related: #5
The text was updated successfully, but these errors were encountered: