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
letstartOfNonTrimmedRange= idx // Points at the first char not in the set
120
+
guard startOfNonTrimmedRange != endIndex else{
121
+
returnself[endIndex...]
122
+
}
123
+
124
+
letbeforeEnd=index(endIndex, offsetBy:-1)
125
+
guard startOfNonTrimmedRange < beforeEnd else{
126
+
returnself[startOfNonTrimmedRange ..< endIndex]
127
+
}
128
+
129
+
varbackIdx= beforeEnd
130
+
// No need to bound-check because we've already trimmed from the beginning, so we'd definitely break off of this loop before `backIdx` rewinds before `startIndex`
0 commit comments