Calling function consume 100 bytes of program mem?

Hello, I want to decrease the size of my sketch. I have wrote the web server which is serving the webpages. In lot of places I had a strings like:
F(“Text:”);

I was thinking to reduce the prog size to create the method like that:

String createTextBoxTableRow(String caption, String name, String maxSize) {
String retStr = F("");
retStr += caption;
retStr += F("");
return retStr;
}

and then call the method where it is needed. e.g.:

outputString = F(“”);
outputString += createTextBoxTableRow(F(“Wifi SSID:”), “s”, “32”);
outputString += createTextBoxTableRow(F(“Wifi password:”), “p”, “64”);

However, the problem is, that each call to that created function consume almost 100 bytes of the sketch size, it is even more, then if I will write the full string like I had before. Can someone tell me why?

WIFI config

Hello, I want to decrease the size of my sketch.

So why are you using the String class?

So you think, that the problem is the String class? OK, I can use char, however how can I use it together with F() macro?

OK, I can use char, however how can I use it together with F() macro?

You can't. The F() macro is to keep string literals, not string variables, and certainly not useless String variables, out of SRAM. Any string variable, by definition, needs to be in SRAM. As does any memory-wasting String variable.