I saw questions related to the line builder, but could not find the answer.
My question is: "Is it useful to use a line builder here if you do not use it wisely here."
This method will work 100,000 times. To save some memory, I used stringbuilder here. but the problem is the method .ToString(). In any case, I will have to create a string using the method .ToString(), so why not initialize filenameas a string, not StringBuilder.
internal bool isFileExists()
{
StringBuilder fileName = new StringBuilder(AppDomain.CurrentDomain.BaseDirectory + "Registry\\" + postalCode + ".html");
if (System.IO.File.Exists(fileName.ToString()))
{
return true;
}
else
{
return false;
}
}
All library methods use a string as a parameter, not a string builder, why? I think I have a lot of confusion in my concepts.