How to take the input from user in console or file with ease in c#? -


I am a C ++ user and now I am trying to use C #.

The user had fun taking input from C ++ (just >> >>) and supported all types. So for the file, but in C #, this is very complicated, because I can only take the wire. Then I have to manipulate it for later use.

And if I want to take a separate line for white scrapping on the same line, then it becomes more complicated because I have to go for string partition. Then the conversion ...

It may be for error handling and secure code. But I'm frustrated anyway from C #.

Are you all experts here, is there any easy way?

As far as I know, you have to make it harder way. (On the bright side, however, C ++;), the hard way is easier;)

Console.OpenStandardInput () gives input streams, so it can be considered similar to files, but You have to do string partitions yourself if you need it. Of course, there is a good Reggae Library in C # which can help here.

T. The terriers (where T integers, floats, whatever type you want to read) allow you to convert those types to string.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -