Is there any noticeable benefit regarding performance on using a constant over a string. Suppose the following case
public void MethodUsingConstant()
{
const string searchedText = "foo";
//some operations using searchedText string
}
public void MethodNoUsingConstant()
{
string searchedText = "foo";
//some operations using searchedText string
}
There is also the option to take this to a class-struct constant field.
Or, should I avoid to overthink too much these micro optimizations?