ahbsd.lib
1.6.0
dotnet add package ahbsd.lib --version 1.6.0
NuGet\Install-Package ahbsd.lib -Version 1.6.0
<PackageReference Include="ahbsd.lib" Version="1.6.0" />
paket add ahbsd.lib --version 1.6.0
#r "nuget: ahbsd.lib, 1.6.0"
// Install ahbsd.lib as a Cake Addin #addin nuget:?package=ahbsd.lib&version=1.6.0 // Install ahbsd.lib as a Cake Tool #tool nuget:?package=ahbsd.lib&version=1.6.0
Version 1.6
Simplifing string.IsNullOrEmpty()
and string.IsNullOrWhiteSpace()
and the extraction of numbered lists in a string
.
Example for the extraction
If you have a numbered list, e.g.: "1,2, 5, 99 ,8"
and want to get an array or List with the numbers, you can solve it e.g. like this:
string numberedList = "1,2, 5, 99 ,8";
// for a result array:
string[] numbers = numberedList.Split(',');
int[] intNumbers = new int[numbers.Count];
for (int i = 0; i < numbers.Count; i++)
{
if (int.TryParse(numbers[i].Trim(), out int number)
{
intNumbers[i] = number;
}
}
// for a result list:
IList<int> numberList = new List<int>();
foreach (string sNumber in numberedList.Split(','))
{
if (int.TryParse(sNumber.Trim(), out int number)
{
numberList.Add(number);
}
}
much shorter (because the last part is more ore less included) is the following:
string numberedList = "1,2, 5, 99 ,8";
IList<int> numberList = numberedList.GetIntList();
additionally the Extension also allows to set the splitter:
string numberedList = "1;2; 5; 99 ;8";
IList<int> numberList = numberedList.GetIntList(';');
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 was computed. 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 was computed. 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.1 is compatible. |
-
.NETCoreApp 3.1
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on ahbsd.lib:
Package | Downloads |
---|---|
ahbsd.lib.numbersystems
A library for changing number bases UINT only. I first had the idea of making a library like this, when I helped a person of business school to understand number systems. In my eyes the best way to describe how binary and hexadecimal work, is to help understand the basics on numeric bases. So after this person was able to describe the transformation in general, I started documentation and coding it. See on GitHub (most in german). |
|
ahbsd.lib.macadress.api_core3.1
Simple static class to get the vndor of a MAC adress. See https://macvendors.com/api |
|
ahbsd.lib.Exceptions_Core-5.0
The newer version for .NET CORE 5.0 |
|
ahbsd.network.check_core3.1
A Simple check, if a network address is reachable |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version 1.5 has added some functionallity and removed a lot of SonarLint issues