ToString

Jay1b

Contributor
Joined
Aug 3, 2003
Messages
640
Location
Kent, Uk.
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)
 
What are you trying to do, Jay1b? If you have an int and want to format it, use this:
Visual Basic:
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:
Visual Basic:
Dim s As String = "123"Dim i As Integer
Dim i As Integer = Convert.ToInt32(s)

-Ner
 
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 :)
 
Back
Top