I’m trying to reduce the sketch size of my program and I have narrow them to these six lines consist of a String …

These 6 lines of codes takes up 964 Bytes of storage space…

Can anyone help to explain why this happens ??

With the 6 lines of codes :-

Sketch uses **25,220 bytes (82%)** of program storage space. Maximum is 30,720 bytes.

Global variables use 1,205 bytes (58%) of dynamic memory, leaving 843 bytes for local variables. Maximum is 2,048 bytes.

Without the 6 lines of codes :-

Sketch uses **24,256 bytes (78%)** of program storage space. Maximum is 30,720 bytes.

Global variables use 1,199 bytes (58%) of dynamic memory, leaving 849 bytes for local variables. Maximum is 2,048 bytes.

```
String cmtOut = "";
cmtOut.concat("@");
cmtOut.concat(padding((int) gps.course.deg(),3));
cmtOut.concat("/");
cmtOut.concat(padding((int)gps.speed.mph(),3));
cmtOut.concat("/A=");
cmtOut.concat(padding((int)gps.altitude.feet(),6));
cmtOut.concat(" Seq:");
cmtOut.concat(txCounter);
String padding( int number, byte width ) {
String result;
// Prevent a log10(0) = infinity
int temp = number;
if (!temp) { temp++; }
for ( int i=0;i<width-(log10(temp))-1;i++) {
result.concat('0');
}
result.concat(number);
return result;
}
```