I’ve recently learned about the StringBuilder and why it is better over a variable of type string - especially when the string will be modified a lot.
What does C# do when a variable of type var is used for a sting? Does it treat it like it was declared as a string, as a StringBuilder, or something else?
FWIW - I’m old school and am used to strings being char[], and having to handle strings like:
char body[1000];
strcpy(body, "Dear customer\n");
strcat(body, "Your order has shipped");
And I’ve not seen anyone use calloc, malloc, realloc, or free lately
var is just a the same as using string, or int except the compiler determines the type. If the “returning” type is StringBuilder then var will be of StringBuilder so it all depends on what the right side of the assignment is doing.