Combining code from two atlas scientific sensors

I want to combine the code for my Dissolved Oxygen Probe and my CO2 sensor from atlas scientific. I am having trouble with the input string.

#include <SoftwareSerial.h> //we have to include the SoftwareSerial library, or else we can't use it
#define rxo 2 //define what pin rx on Oxygen Probe is going to be
#define txo 3 //define what pin tx on Oxygen Probe is going to be
#define rxc 4 //define what pin rx on CO2 is going to be
#define txc 5 //define what pin tx on CO2 is going to be

SoftwareSerial oxport(rxo, txo);
SoftwareSerial coport(rxc, txc);

String sensorstring_o = ""; //a string to hold the data from the Atlas Scientific product
String sensorstring_c = "";
boolean sensor_string_complete_o = false; //have we received all the data from the Atlas Scientific product
boolean sensor_string_complete_c =false;
String payload = "";
String inputstring_o = "";
String inputstring_c = "";
boolean input_string_complete_o = false;
boolean input_string_complete_c = false;

void setup() {
Serial.begin(9600); //set baud rate for the hardware serial port_0 to 9600
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
oxport.begin(9600); //set baud rate for the software serial port to 9600
coport.begin(9600);
sensorstring_o.reserve(30); //set aside some bytes for receiving data from Atlas Scientific product
sensorstring_c.reserve(30);
inputstring_o.reserve(10);
inputstring_c.reserve(10);
}

void serialEvent() { //if the hardware serial port_0 receives a char
inputstring_o = Serial.readStringUntil(13); //read the string until we see a
input_string_complete_o = true;

}

void loop() {

if (input_string_complete_o == true) { //if a string from the PC has been received in its entirety
oxport.print(inputstring_o); //send that string to the Atlas Scientific product
oxport.print('\r'); //add a to the end of the string
coport.print(inputstring_o);
coport.print('\r');
inputstring_o = ""; //clear the string
input_string_complete_o = false; //reset the flag used to tell if we have received a completed string from the PC
}

oxport.listen();
if (oxport.available() > 0) { //if we see that the Atlas Scientific product has sent a character
char inchar_o = (char)oxport.read(); //get the char we just received
sensorstring_o += inchar_o; //add the char to the var called sensorstring
if (inchar_o == '\r') { //if the incoming character is a
sensor_string_complete_o = true; //set the flag
}
}

coport.listen();
if (coport.available() > 0) { //if we see that the Atlas Scientific product has sent a character
char inchar_c = (char)coport.read(); //get the char we just received
sensorstring_c += inchar_c; //add the char to the var called sensorstring
if (inchar_c == '\r') { //if the incoming character is a
sensor_string_complete_c = true; //set the flag
}
}

if (sensor_string_complete_o == true && sensor_string_complete_c == true) { //if a string from the Atlas Scientific product has been received in its entirety
payload += "{"oxygen":";
payload += sensorstring_o;
payload += ", "CO2":";
payload += sensorstring_c;
payload += "}";
Serial.println(payload);

sensorstring_c = "";
sensor_string_complete_c = false;
sensorstring_o = "";
sensor_string_complete_o = false;
}
delay(2000);

}

Please read "Read this before posting a programming question" at the top of the forum.

You need to be a little lot more specific about your problem.

What is the problem ?

Why are you using Strings rather than strings ? They are generally regarded as a bad thing in the small memory of a microcontroller, particularly when frequent changes are made to them in the program