An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

vst.stringparse

Provides a Parse generic extension method for string that converts string to T and no boxing occurs ``` C# // The following code does not occur boxing var a1 = "123".Parse<int>(); // a1 == 123 var a3 = "123".Parse<int?>(); // a3 == 123 ``` # Usage example ``` C# using System; using System.Globalization; using StringParse; void Exmaple1() { _ = "12".Parse<int>(); // 12 // _ = "ss".Parse<int>(); // throw FormatException // with default value, Actually call the TryParse method internally _ = "12".ParseOr(10); // 12 _ = "ss".ParseOr(10); // 10 // with NumberStyles _ = "F".Parse<int>(NumberStyles.HexNumber); // 15 // parse Nullable _ = "12".Parse<int?>(); // 12 // _ = "ss".Parse<int?>(); // throw FormatException // TryParse _ = "12".TryParse(out int _); // true _ = "ss".TryParse(out int _); // false // Parse Enum _ = "Saturday".ParseEnum<DayOfWeek>(); // DayOfWeek.Saturday _ = "Saturday".TryParseEnum(out DayOfWeek _); // true } ```

Ecosystem
nuget.org
Latest Release
2.0.0
about 3 years ago
Versions
7
Downloads
4,438 total
Links
Registry nuget.org
Source Repository
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:nuget/vst.stringparse
spec
License MIT
First Release about 5 years ago
Last Synced 7 days ago
Repository
Stars 0 on GitHub
Forks 0 on GitHub