Making a String a certain length.

Thanks for your help.

I have now progressed to putting three variables into 1 string which I can feed into the code to create the HEX string that will operate the numbers.

Code below which I have used to prove the concept.

void setup() {
  // put your setup code here, to run once:

 

 Serial.begin(19200);
}

void loop() {
  // put your main code here, to run repeatedly:

   int runs = 199;
    int wkts = 3;
     int overs = 24;

   char cruns [4];
   sprintf(cruns, "%03d", runs);

    char cwkts [4];
   sprintf(cwkts, "%03d", wkts);

    char covers [4];
   sprintf(covers, "%03d", overs);

   Serial.println(cruns);
   Serial.println(cwkts);
   Serial.println(covers);

   String StringRuns = String(cruns);
   String StringWkts = String(cwkts);
   String StringOvers = String(covers);
   String Output = String (StringRuns+StringWkts+StringOvers);
  

  Serial.print ("The runs are ");
  Serial.println(StringRuns);

   Serial.print ("The wkts are ");
  Serial.println(StringWkts);
   Serial.print ("The overs are ");
  Serial.println(StringOvers);
  Serial.println(Output);
  

  delay(1000);

}