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
Currently we are using a workaround which is really slow (indexing is O(N) instead of the expected O(1)) and really ugly (String(str[str.index(str.startIndex, offsetBy: i]) instead of str[i]).
So we have to introduce a StringIndex type which uses number underlying on every language expect Swift where it maps to String.Index type. We also need to add some helper methods eg. str.startIndex which gives 0 usually, except in Swift where it gives str.startIndex.
The text was updated successfully, but these errors were encountered:
You cannot index a string with a number in Swift.
Currently we are using a workaround which is really slow (indexing is
O(N)
instead of the expectedO(1)
) and really ugly (String(str[str.index(str.startIndex, offsetBy: i])
instead ofstr[i]
).So we have to introduce a StringIndex type which uses number underlying on every language expect Swift where it maps to
String.Index
type. We also need to add some helper methods eg.str.startIndex
which gives0
usually, except in Swift where it givesstr.startIndex
.The text was updated successfully, but these errors were encountered: