Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. uint.Parse() vs. Convert.ToUint32()

uint.Parse() vs. Convert.ToUint32()

Scheduled Pinned Locked Moved C#
csharpdotnetvisual-studioquestion
7 Posts 3 Posters 6 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    moredip
    wrote on last edited by
    #1

    Question 1 (20 Marks): Compare and contrast the int.Parse() and Convert.ToUint32() methods available in the .NET Framework. Extra credit will be awarded for RTFMs ;) Seriously though, what's the differences and advantages/disadvantages between the two? Cheers, Pete

    S 1 Reply Last reply
    0
    • M moredip

      Question 1 (20 Marks): Compare and contrast the int.Parse() and Convert.ToUint32() methods available in the .NET Framework. Extra credit will be awarded for RTFMs ;) Seriously though, what's the differences and advantages/disadvantages between the two? Cheers, Pete

      S Offline
      S Offline
      Stephane Rodriguez
      wrote on last edited by
      #2

      Convert.ToInt32 is actually based on ... Int32.Parse. :laugh:

      public static int Convert.ToInt32(string value) {
      if (value == null)
      return 0;
      return Int32.Parse(value);
      }

      M 1 Reply Last reply
      0
      • S Stephane Rodriguez

        Convert.ToInt32 is actually based on ... Int32.Parse. :laugh:

        public static int Convert.ToInt32(string value) {
        if (value == null)
        return 0;
        return Int32.Parse(value);
        }

        M Offline
        M Offline
        moredip
        wrote on last edited by
        #3

        Thanks! I suspected that was the case (or vice versa) :laugh: So the only difference is that Convert handles nulls then? BTW, if that code the actual method within the framework, or just an example of how it's probably implemented? If it is the actual method, how did you find it?

        S 1 Reply Last reply
        0
        • M moredip

          Thanks! I suspected that was the case (or vice versa) :laugh: So the only difference is that Convert handles nulls then? BTW, if that code the actual method within the framework, or just an example of how it's probably implemented? If it is the actual method, how did you find it?

          S Offline
          S Offline
          Stephane Rodriguez
          wrote on last edited by
          #4

          moredip wrote: If it is the actual method, how did you find it It is the actual code. Anakrino[^] (.NET decompiler which produces C# and MC++ code).

          M 1 Reply Last reply
          0
          • S Stephane Rodriguez

            moredip wrote: If it is the actual method, how did you find it It is the actual code. Anakrino[^] (.NET decompiler which produces C# and MC++ code).

            M Offline
            M Offline
            moredip
            wrote on last edited by
            #5

            Huh! That's cool :-D

            L 1 Reply Last reply
            0
            • M moredip

              Huh! That's cool :-D

              L Offline
              L Offline
              leppie
              wrote on last edited by
              #6

              Or you can have a look in the shared source, nicer looking code there :) I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02

              M 1 Reply Last reply
              0
              • L leppie

                Or you can have a look in the shared source, nicer looking code there :) I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02

                M Offline
                M Offline
                moredip
                wrote on last edited by
                #7

                Hey, just tell me where to find it ;)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups