CKTIS / C#
System.IO.Path: referência prática
System.IO.Path: referência prática: Path manipula a sintaxe de caminhos sem aceder ao sistema de ficheiros.
Versão: .NET API; verified on .NET 10.0.14
Sintaxe
System.IO.Path /* select a documented member or constructor */Path manipula a sintaxe de caminhos sem aceder ao sistema de ficheiros.
Usa Combine, Join e GetExtension em vez de inserir separadores manualmente.
Raízes, separadores e maiúsculas dependem da plataforma e normalizar não é autorizar.
GetExtension pode devolver texto vazio; caracteres e comprimentos inválidos dependem do sistema e da operação.
O programa completo usa realmente System.IO.Path; o stdout exato esperado é .json.
Exemplos
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"));
Resultado
.json
O programa completo usa realmente `System.IO.Path`; o stdout exato esperado é `.json`.