S
S
Shoyo2021-09-29 18:59:27
C++ / C#
Shoyo, 2021-09-29 18:59:27

How to autocomplete in the interactive console?

When you enter a phone number into the console, a prompt should appear. Enter in green letters. Part of the hint is gray. The hint numbers are taken from the saved number file. For example, the user entered "897", the file has a saved number (numbers) with the same beginning, then the first one found is selected and its remainder is substituted in gray at the end of the input line. In this case, the input cursor does not go to the end of the line. If the user presses ENTER with a half entered number, then the number is appended

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilya, 2021-09-29
@Shoyo

I would intercept keystrokes with Console. ReadKey(true) and render any output you want with cursor shift and Console.Write

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question