I have some -really long- string literals in my application. Does it differ to define them in a method like:
public string DoSomething()
{
string LongString = "...";
// ...
}
or as a const field in the lass like:
private const string LongString = "...";
public string DoSomething()
{
// ...
}
The DoSomething() method will be called many many times, is the LongString created and destroyed each time if I define it inside the method, or the compiler takes care?
@designator is invaluable.constwithin the method.