Skip to content
Discussion options

You must be logged in to vote

Was this added to C# recently,

Yes. Though 'recent' only relative to the age of the universe. This functionality was available in C#1.0

or is it a bug?

It is not a bug. (Practically) all types in .Net extend from System.Object and thus have the ability to convert themselves to strings with .ToString(). String concatenation is thus supported in C# for all of these types through the use of combining the actual strings, and the stringified values into one final string.

I was demonstrating static typing to a friend who is trying to learn C#

Note: C# is statically typed. And in this scenario static typing is in effect. Static typing does not mean that strings cannot be concatenated to no…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@DukeOfSuffix
Comment options

@CyrusNajmabadi
Comment options

Answer selected by DukeOfSuffix
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants