Dave Zych
  • Home
  • About
  • Contact
  • Privacy

concatenation

A collection of 1 post
boxing

When doing string concatenation in C#, why don't you have to call ToString on non string variables?

To get the string representation of a variable, in this case we’ll use int, there is no implicit conversion from int to string so you can call the ToString method: string s = myInt; //INVALID!! string s = myInt.ToString(); // Valid! When concatenating with another string, though, you don’t have
Oct 23, 2013 1 min read
Page 1 of 1
Dave Zych © 2025
  • Data & privacy
  • Contact
Powered by Ghost