146 {
147 bool flag = false;
148 int num = rootLength;
150 {
151 num--;
152 }
153 if (num > 0)
154 {
155 sb.Append(path.
Slice(0, num));
156 }
157 for (
int i = num;
i < path.
Length;
i++)
158 {
161 {
163 {
164 continue;
165 }
167 {
169 continue;
170 }
172 {
173 int num2;
174 for (num2 = sb.Length - 1; num2 >= num; num2--)
175 {
177 {
178 sb.Length = ((
i + 3 >= path.Length && num2 == num) ? (num2 + 1) : num2);
179 break;
180 }
181 }
182 if (num2 < num)
183 {
184 sb.Length = num;
185 }
187 continue;
188 }
189 }
190 if (c != '\\' && c == '/')
191 {
192 c = '\\';
193 flag = true;
194 }
195 sb.Append(c);
196 }
197 if (!flag && sb.Length == path.
Length)
198 {
199 return false;
200 }
201 if (num != rootLength && sb.Length < rootLength)
202 {
203 sb.Append(path[rootLength - 1]);
204 }
205 return true;
206 }
static bool IsDirectorySeparator(char c)
ReadOnlySpan< T > Slice(int start)