Jump to content

C# String Parsing Doubt 01

- - - - -

  • Please log in to reply
2 replies to this topic

#1
gautham

gautham

    Learning Programmer

  • Members
  • PipPipPip
  • 33 posts

For int and char we use: int.Parse and char.Parse but why it is different for a "String"?

why we directly say: ch=Console.ReadLine();



thank you.

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Because int.Parse and char.parse are parsing a string as input. ReadLine() returns a string, so no need to parse it as a string.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
gautham

gautham

    Learning Programmer

  • Members
  • PipPipPip
  • 33 posts
@WingedPanther

Thank you




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users