CKTIS / C#
System.IO.Path: odniesienie praktyczne
System.IO.Path: odniesienie praktyczne: Path manipuluje składnią ścieżek bez dostępu do systemu plików.
Wersja: .NET API; verified on .NET 10.0.14
Składnia
System.IO.Path /* select a documented member or constructor */Path manipuluje składnią ścieżek bez dostępu do systemu plików.
Stosuj Combine/Join/GetExtension zamiast ręcznych separatorów.
Reguły korzeni, separatorów i wielkości liter są platformowe; normalizacja nie jest autoryzacją.
GetExtension może zwrócić pusty string; niepoprawne znaki i długości zależą od systemu oraz późniejszej operacji.
Kompletny program rzeczywiście używa System.IO.Path; oczekiwany stdout to dokładnie .json.
Przykłady
using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;
Console.WriteLine(Path.GetExtension("report.json"));
Wynik
.json
Kompletny program rzeczywiście używa `System.IO.Path`; oczekiwany stdout to dokładnie `.json`.