With the exercises in the last section, we have all we need for a much improved
User Input library class. This will be the class
We have the original
and assorted supporting functions.
The only changes to individual methods were to make
sure that the static methods are public.
Henceforth we will be using
UI in place of
UIF. In fact all the places
was used before could be replaced by
It includes all the functionality of
You can look at the code all together in ui/ui.cs.
There are even fancier ways of arranging for legal numeric input.
We have only been reading whole lines, but it is possible to read
individual characters with
without a newline being entered yet. A much more extensive advanced
subject is the special regular expression language for
describing arbitrary patterns in strings using the
Though we will not discuss the details, another slick replacement for UI
using these features is in the example class uifnt/UIFNT.cs.