Simple enough lol. Now, sometimes it says it cant put a string to a int, so I have to convert it. Im doing Convert.ToInt32() and all that. My question is, what is different about the Convert.ToString() compared to the blah.blah.ToString?
Well for instance I have a string. But I have 2 integers that I want to add up and add it inside the string. In order to put the total value inside the string, I have to convert the integer into a string. Idk, im new. Im most likely doing it wrong.
Can't you just add the two integers together and then convert that into a string?
String Blah1 = Num1.ToString()
Really? You can't use CStr in C#? What a load of bull.
int in C++ means initialize not integer. I'm pretty sure it means that in c# too.
Nope. int (C#) = Integer (VB).
Dragoons Master
Unregistered
Beres Wrote:My question is, what is different about the Convert.ToString() compared to the blah.blah.ToString?
Convert.ToString() is a bunch of functions from the .Net Framework.
.ToString() is a class member function. The thing is that every type in C# already has the implementation of the ToString function, even your custom classes(the default shows the object name, if I remember correctly). The good thing about this is that you can make your own ToString() functions for your custom classes, using the override reserved word.
Code:
public override string ToString()
{
return "anything";
}