2
Answers

How is this returning a new instance?

Ask a question
S

S

12y
999
1
Hi

Given the following code example

// It returns the altered argument as a new instance of string.

public static string BetterThanPassTheReference(string argument)
{ return argument + " ABCDE"; }

I might be missing something obvious here but how is this method returning a new instance of string?

Could this be a shorthand notation for the following:-

String returnArguement = arguement + "ABCDE";

return returnArguement;

Regards




Answers (2)