Results 1 to 8 of 8

Thread: Convert number to string

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2002
    Location
    ON, CAN
    Posts
    265

    Convert number to string

    hello,

    how can i covert say 12 to a charater string "12"?

    boy, i miss vb

    regan

  2. #2
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    never fear, c# is your friend

    PHP Code:
            private void Form1_Load(object senderSystem.EventArgs e)
            {
                 
    int mynumber =123456;
                 
    mynumber.ToString();
            } 
    MOST OBJECTS IN C# HAVE .ToString();

  3. #3
    Junior Member
    Join Date
    Feb 2002
    Location
    London UK
    Posts
    29

    or more accurately

    Most objects in the .NET framework have .ToString

    There is no difference between objects in any language under .NET.

    cheers
    Simon

  4. #4
    Hyperactive Member
    Join Date
    Apr 1999
    Location
    Prague, Czech Republic
    Posts
    350
    Well, you could also use System.Convert class to provide additional conversions. And I think (string)12 or 12.ToString() would also run, won't it?

  5. #5
    Lively Member
    Join Date
    Aug 1999
    Location
    Amsterdam
    Posts
    117
    or more accurately

    All objects in the .NET framework have ToString.
    ToString is a method of System.Object and all objects are finally derived from System.Object.

  6. #6
    Junior Member
    Join Date
    Feb 2002
    Location
    London UK
    Posts
    29
    I stand corrected .. you are indeed right.

    Cheers

    Simon

  7. #7
    BG
    Guest
    Even Strings have the ToString() method

  8. #8
    Junior Member
    Join Date
    Feb 2002
    Location
    London UK
    Posts
    29
    spooky


    Simon

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width