✅ when programming a CLI in C#...

1. how can i open my own CLI window like how starting the python repl works? 2. how can i take input with a string predecessor? i want to do >>> ... but there isnt a way to get an input on the same line as text, as far as ive seen
10 Replies
reflectronic
reflectronic3mo ago
what do you mean by opening your own CLI window if you write a console program, when you open it, it opens a new console window it just does that Console.Write(">>> "); var i = Console.ReadLine();
it’s raining outside
readline reads the NEXT line not the same line that would do
>>>
...
>>>
...
i want to do
>>> ...
>>> ...
reflectronic
reflectronic3mo ago
No description
it’s raining outside
OHH .Write i thought you said .WriteLine() apologies
TizzyT
TizzyT3mo ago
1) install the global tool C# repl: https://github.com/waf/CSharpRepl 2) Console.ReadLine() returns the user input line
GitHub
GitHub - waf/CSharpRepl: A command line C# REPL with syntax highlig...
A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively. - waf/CSharpRepl
it’s raining outside
i dont think that was my question how does this relate, if i may ask?
TizzyT
TizzyT3mo ago
You didn't ask to run a C# Repl "like starting a python repl"?, I may have misunderstood if not.
it’s raining outside
oh sorry for the misconception i meant taking input on the same line as where you've written text to the console
TizzyT
TizzyT3mo ago
Ah, gotcha. Apologies
it’s raining outside
no problem alr solved
Want results from more Discord servers?
Add your server