Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    [C#] Converting from int to string

    Hi guys,

    How can I convert an int to a string in C#? This is my code now:

    Code:
            public Form3()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                int i = 9;
                MessageBox.Show(i);
            }
    I know there is a much easyer way to get a 9 into a messagebox, but as you may understand, the actual problem is a lot bigger, I want to try to solve that myself before calling in any help

    Anyone? Thanks in advance!
    Last edited by Scientist_nl; 10-26-2007 at 03:44 PM.

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    There are quite a few methods. A simple Google query will yield an applicable solution.

  • #3
    Senior Coder BarrMan's Avatar
    Join Date
    Feb 2005
    Location
    Israel.
    Posts
    1,644
    Thanks
    69
    Thanked 83 Times in 82 Posts
    Code:
    int intNumber = 12947;
    string strNumber = Convert.toString(intNumber);
    Last edited by BarrMan; 10-27-2007 at 02:45 PM.

  • #4
    New to the CF scene
    Join Date
    Sep 2007
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Got it working already, this one is solved!

    99999 issues to go


  •  

    Posting Permissions

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