Utf8Utility 1.0.0
.NET 7.0
This package targets .NET 7.0. The package is compatible with this framework or higher.
.NET Standard 2.1
This package targets .NET Standard 2.1. The package is compatible with this framework or higher.
dotnet add package Utf8Utility --version 1.0.0
NuGet\Install-Package Utf8Utility -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Utf8Utility" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Utf8Utility --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Utf8Utility, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Utf8Utility as a Cake Addin #addin nuget:?package=Utf8Utility&version=1.0.0 // Install Utf8Utility as a Cake Tool #tool nuget:?package=Utf8Utility&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Utf8Utility
UTF-8関連のユーティリティライブラリです。
説明
Utf8Utilityは、UTF-8関連処理の実装を詰め合わせたライブラリです。
インストール
NuGet(正式リリース版)
dotnet add package Utf8Utility
Azure Artifacts(開発用ビルド)
dotnet add package Utf8Utility -s https://pkgs.dev.azure.com/finphie/Main/_packaging/DotNet/nuget/v3/index.json
使い方
using System;
using Utf8Utility;
using Utf8Utility.Text;
// stringまたはUTF-8のバイト配列、ReadOnlySpan{char|byte}を指定できます。
var array = new Utf8Array("abc");
var span = array.AsSpan();
// バイト数
var byteCount = array.ByteCount;
// 文字数
var length1 = array.GetLength();
var length2 = UnicodeUtility.GetLength(span);
// 空かどうか
var isEmpty = array.IsEmpty;
// 空か空白文字列かどうか
var isEmptyOrWhiteSpace1 = array.IsEmptyOrWhiteSpace();
var isEmptyOrWhiteSpace2 = UnicodeUtility.IsEmptyOrWhiteSpace(span);
// Ascii文字列かどうか
var isAscii1 = array.IsAscii();
var isAscii2 = UnicodeUtility.IsAscii(span);
// 内部配列への参照
ref var start = ref array.DangerousGetReference();
// 比較
var compareTo = array.CompareTo(array);
var compare1 = Utf8Array.CompareOrdinal(array, array);
var compare2 = Utf8Array.Compare(array, array, StringComparison.CurrentCulture);
var compare3 = UnicodeUtility.Compare(span, span, StringComparison.CurrentCulture);
var empty = Utf8Array.Empty;
var equals = array.Equals(array);
var hash = array.GetHashCode();
var utf16 = array.ToString();
_ = array.TryFormat(stackalloc char[256], out var charsWritten);
_ = array.TryFormat(stackalloc byte[256], out var bytesWritten);
array.CopyTo(stackalloc byte[256]);
_ = array.TryCopyTo(stackalloc byte[256]);
var chars = array.GetChars(stackalloc char[256]);
_ = array.TryGetChars(stackalloc char[256], out var charsWritten);
// Utf8ArrayをキーとしたDictionaryです。
var dict = new Utf8ArrayDictionary<int>();
// キー指定にはUtf8Arrayの他にReadOnlySpan{char|byte}を指定できます。
_ = dict.TryGetValue(array, out var result);
ref var dictStart = ref dict.GetValueRefOrNullRef(array);
_ = dict.TryAdd(array, 1);
dict.Clear();
サポートフレームワーク
- .NET 8
- .NET 7
- .NET Standard 2.1
作者
finphie
ライセンス
MIT
クレジット
このプロジェクトでは、次のライブラリ等を使用しています。
ライブラリ
テスト
- FluentAssertions
- Microsoft.NET.Test.Sdk
- Newtonsoft.Json
- NuGet.Frameworks
- xunit
- xunit.runner.visualstudio
アナライザー
- Microsoft.CodeAnalysis.NetAnalyzers (SDK組み込み)
- Microsoft.VisualStudio.Threading.Analyzers
- StyleCop.Analyzers
ベンチマーク
- BenchmarkDotNet
- CommandLineParser
- Iced
- Microsoft.CodeAnalysis.CSharp
- Microsoft.Diagnostics.NETCore.Client
- Microsoft.Diagnostics.Runtime
- Microsoft.Diagnostics.Tracing.TraceEvent
- Perfolizer
その他
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.1
- CommunityToolkit.Diagnostics (>= 8.2.1)
- CommunityToolkit.HighPerformance (>= 8.2.1)
- System.Runtime.CompilerServices.Unsafe (>= 6.0.0)
-
net7.0
- CommunityToolkit.Diagnostics (>= 8.2.1)
- CommunityToolkit.HighPerformance (>= 8.2.1)
-
net8.0
- CommunityToolkit.Diagnostics (>= 8.2.1)
- CommunityToolkit.HighPerformance (>= 8.2.1)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Utf8Utility:
Package | Downloads |
---|---|
SimpleTextTemplate.Abstractions
SimpleTextTemplateの抽象化です。 |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 460 | 9/10/2023 |
0.13.0 | 272 | 3/19/2023 |
0.12.0 | 1,035 | 2/26/2022 |
0.11.1 | 2,230 | 1/10/2022 |
0.11.0 | 286 | 1/8/2022 |
0.10.0 | 424 | 11/7/2021 |
0.9.1 | 380 | 10/21/2021 |
0.9.0 | 1,047 | 10/17/2021 |
0.8.0 | 1,417 | 8/29/2021 |
0.7.0 | 424 | 7/24/2021 |
0.6.0 | 428 | 6/19/2021 |
0.5.0 | 959 | 5/29/2021 |
0.4.1 | 403 | 5/22/2021 |
0.4.0 | 952 | 5/15/2021 |
0.3.0 | 443 | 5/8/2021 |
0.2.0 | 415 | 5/8/2021 |