Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetExtension() [1/2]

static ReadOnlySpan< char > System.IO.Path.GetExtension ( ReadOnlySpan< char > path)
inlinestatic

Definition at line 177 of file Path.cs.

178 {
179 int length = path.Length;
180 for (int num = length - 1; num >= 0; num--)
181 {
182 char c = path[num];
183 if (c == '.')
184 {
185 if (num != length - 1)
186 {
187 return path.Slice(num, length - num);
188 }
189 return ReadOnlySpan<char>.Empty;
190 }
191 if (PathInternal.IsDirectorySeparator(c))
192 {
193 break;
194 }
195 }
196 return ReadOnlySpan<char>.Empty;
197 }
ReadOnlySpan< T > Slice(int start)

References System.ReadOnlySpan< T >.Empty, System.IO.PathInternal.IsDirectorySeparator(), System.length, System.ReadOnlySpan< T >.Length, and System.ReadOnlySpan< T >.Slice().