CKTIS / C#
System.IO.Path: практическа справка
System.IO.Path: практическа справка: Path обработва синтаксиса на пътища без достъп до файловата система.
Версия: .NET API; verified on .NET 10.0.14
Синтаксис
System.IO.Path /* select a documented member or constructor */Path обработва синтаксиса на пътища без достъп до файловата система.
Използвайте Combine, Join и GetExtension вместо ръчно добавяне на разделители.
Правилата за корен, разделители и регистър зависят от платформата, а нормализацията не е авторизация.
GetExtension може да върне празен низ; невалидните знаци и дължини зависят от системата и операцията.
Пълната програма действително използва System.IO.Path; точният очакван stdout е .json.
Примери
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"));
Резултат
.json
Пълната програма действително използва `System.IO.Path`; точният очакван stdout е `.json`.