austen.ConsoleHelperLibrary
1.0.15
dotnet add package austen.ConsoleHelperLibrary --version 1.0.15
NuGet\Install-Package austen.ConsoleHelperLibrary -Version 1.0.15
<PackageReference Include="austen.ConsoleHelperLibrary" Version="1.0.15" />
<PackageVersion Include="austen.ConsoleHelperLibrary" Version="1.0.15" />
<PackageReference Include="austen.ConsoleHelperLibrary" />
paket add austen.ConsoleHelperLibrary --version 1.0.15
#r "nuget: austen.ConsoleHelperLibrary, 1.0.15"
#:package austen.ConsoleHelperLibrary@1.0.15
#addin nuget:?package=austen.ConsoleHelperLibrary&version=1.0.15
#tool nuget:?package=austen.ConsoleHelperLibrary&version=1.0.15
<h1 align="center"> ConsoleLibraryHelper </h1>
<p align="center"> <a href="https://www.nuget.org/packages/austen.ConsoleHelperLibrary/" alt=""> <img src="https://img.shields.io/nuget/v/austen.ConsoleHelperLibrary" /></a> <a href="https://www.nuget.org/packages/austen.ConsoleHelperLibrary/" alt=""> <img src="https://img.shields.io/nuget/dt/austen.ConsoleHelperLibrary" /></a> <a href="https://badgen.net/badge/icon/github?icon=github&label" alt=""> <img src="https://badgen.net/badge/icon/github?icon=github&label" /></a> <a href="https://img.shields.io/github/license/aus10code/ConsoleHelperLibrary" alt=""> <img src="https://img.shields.io/github/license/aus10code/ConsoleHelperLibrary" /></a> </p>
ConsoleLibraryHelper simplifies the capture of string, boolean, and number types from console users.
To use this library, add the "using ConsoleHelperLibrary" statement
Explanation
You can request either a string, boolean, or number type.
Each of the 3 types have unique requirements you can place on the data you will be requesting. If data returned by user is invalid, it will state the error and prompt the user to try again.
Some requirement examples include a minimum or maximum string length or only allowing positive numbers. They can be used individually or chained together in any order you may like
String
"What is your first name: ".RequestStringFromConsole().WithNoSpaces().Close();
RequestStringFromConsole
WithMinLengthOf(int minLength)WithMaxLengthOf(int maxLength)WithNoSpaces()WithNoSpecialCharacters()WithNoNumbers()WithOnlyTheseOptions(List<string> options)
Number
"What is your age: ".RequestNumberFromConsole<int>.Close();
"How much money do you have: ".RequestNumberFromConsole<decimal>.WithOnlyPositives().Close();
RequestNumberFromConsole<T>
WithMinValueOf(T minimumValue)WIthMaxValueOf(T maximumValue)WithOnlyPositives()WithOnlyNegatives()
Type T can be any of the following number types
- System.Boolean
- System.Byte
- System.Char
- System.Decimal
- System.Double
- System.SByte
- System.Single
- System.UInt16
- System.UInt32
- System.UInt64
Bool
"Are you over 18: ".RequestBoolFromConsole().Close();
The following rules are always true
- All methods extend objects of type string.
- All requirement methods begin with the keyword With
- i.e
WithNoSpaces(),WithNoNumbers()etc..
- i.e
- All request methods must end with a
.Close()
How To Use
Request Number From Console That Is
- An integer
- A positive number
- Greater than 5
- Less than 50

Request String From Console That Contains
- No numbers
- No special characters
- No white spaces

Request Boolean From Console

| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | 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 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. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Updated to net7.0