How can I remove the first digit of the values what my sensors print in serial?

I have a code for two DHT sensors but for some reason the serial print adds "1" before the temperature and humidity values in the case of both sensors (e.g. 123.25 C, 148.12 %).
I assume that I should use the string.remove command but I'm kinnda new in this programming field so I don't know how to put it there correctly to make it work. I tried a lot after reading the general arduino string.remove tutorials and syntax but it still does not work...

My code:

#include <DHT.h>;

#define DHTPIN1 7
#define DHTPIN2 6

DHT dht[] = {
  {DHTPIN1, DHT11},
  {DHTPIN2, DHT22},
};

float humidity[2];
float temperature[2];

void setup()
{
  Serial.begin(9600);
  for (auto& sensor : dht) {
    sensor.begin();
  }
}

void loop()
{
  for (int i = 0; i < 2; i++) {
    temperature[i] = dht[i].readTemperature();
    humidity[i] = dht[i].readHumidity();
  }

  for (int i = 0; i < 2; i++) {
    Serial.print(F("Temperature "));
    Serial.print(i);
    Serial.println(temperature[i]);
    Serial.print(F("Humidity "));
    Serial.print(i);
    Serial.println(humidity[i]);
  }
  delay(5000);
}
 for (int i = 0; i < 2; i++)
  {
    Serial.print(F("Temperature "));
    Serial.print(i);
    Serial.println(temperature[i]);
    Serial.print(F("Humidity "));
    Serial.print(i);
    Serial.println(humidity[i]);
  }

You are printing the array inxex before the values without a space between them

Try this

  for (int i = 0; i < 2; i++)
  {
    Serial.print(F("Temperature "));
    Serial.print(i);
    Serial.print("\t");
    Serial.println(temperature[i]);
    Serial.print(F("Humidity "));
    Serial.print(i);
    Serial.print("\t");
    Serial.println(humidity[i]);
  }

to add a tab between the array index and the value, or simply don't print the value of i

Thank you so much! It works now well!:slight_smile: