Dir.InputString-sample
3.0.0
dotnet add package Dir.InputString-sample --version 3.0.0
NuGet\Install-Package Dir.InputString-sample -Version 3.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="Dir.InputString-sample" Version="3.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Dir.InputString-sample --version 3.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Dir.InputString-sample, 3.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 Dir.InputString-sample as a Cake Addin #addin nuget:?package=Dir.InputString-sample&version=3.0.0 // Install Dir.InputString-sample as a Cake Tool #tool nuget:?package=Dir.InputString-sample&version=3.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
input multi lines text from console
static method
//=================================
// Using static method 'InputString' of class 'Reader'
//=================================
string s, s1;
Console.WriteLine("//////////////////////");
Console.WriteLine("Welcome to Dir.InputString-sample");
Console.WriteLine("//////////////////////");
while (true)
{
//Store multiple lines of data input from the console in variable(s).
s = Dir.InputString.Reader.InputString(0, "Enter multiple lines of data.");
//Display the variable(s).
Console.WriteLine("//////////////////////");
Console.WriteLine(s);
Console.WriteLine("//////////////////////");
//Stores one line of data input from the console in the variable(s1).
//Note that the newline code at the end of the input data has been removed.
s1 = Dir.InputString.Reader.InputString(1, "Exit this loop by typing \"break\".");
//Display the variable(s1).
Console.WriteLine("//////////////////////");
Console.WriteLine(s1);
Console.WriteLine("//////////////////////");
if (s1 == "break") break;
}
instance method
using Dir.InputString;
//=============================================
// Create an instance of class 'Reader'
// How to use instance methods 'GetLineN' and 'GetLength'
//=============================================
string s;
Reader reader;
int length;
while (true)
{
//Enter multiple lines of text from the console
s = Reader.InputString(0, "Easy to paste multiple lines of text stored in the clipboard");
//Create an instance of 'Reader' class. argument is text(string).
reader = new Reader(s);
//Get the number of lines of text(string).
length = reader.GetLength();
Console.WriteLine("The number of lines of this text : " + length.ToString());
Console.WriteLine("/////////// Display text with line numbers ///////////");
for(int i = 0; i < length; i++)
{
s = $"{i + 1} : {reader.GetLineN(i)}";
Console.WriteLine(s);
}
Console.WriteLine("/////////// Display text in reverse order with line numbers ///////////");
for (int i = length - 1; i >= 0; i--)
{
s = $"{i + 1} : {reader.GetLineN(i)}";
Console.WriteLine(s);
}
s = Dir.InputString.Reader.InputString(1, "Exit this loop by typing \"break\".");
if (s == "break") break;
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net6.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.
Version | Downloads | Last updated |
---|---|---|
3.0.0 | 268 | 2/28/2023 |