Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I was having trouble with the tostring command earlier - until i found a better way of doing what i was trying to do - anyway i couldnt get it working.

 

Am I right in thinking its used like this?:

 

Integer.ToString(String)

  • *Experts*
Posted

What are you trying to do, Jay1b? If you have an int and want to format it, use this:

Dim i As Integer
i = 123
Dim s As String = i.ToString("n00")

 

There are various codes you can pass to ToString, depending on how you want the formatting.

 

If you have a string and you're trying to convert to an int, then try this:

Dim s As String = "123"Dim i As Integer
Dim i As Integer = Convert.ToInt32(s)

 

-Ner

"I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Posted

Thanks.

 

I was going to use as a small part of my code, but i found another way of doing about 20 lines of code in 1 line - so i used that :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...