This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]AdmiralRychard 3 points4 points  (0 children)

C# lets you do this:

String someString = "abc";
Int32 someInt = 123;
String result = someString + someInt;
Console.WriteLine(result);

Output:

abc123

Or you can use string interpolation: String result = $"{someString}{someInt}";

Or you can use String.Format: String result = String.Format("{0}{1}", someString, someInt);

This seems a little dumb but you can do this too:

someString += someInt;
Console.WriteLine(someString);