Lose the "String", use an array for your SoftwareSerial objects.
Untested except it compiles.
It would be better to use strtol than atoi and the manual seeking afterwards, but the double pointer use in strtol is confusing.
#include <SoftwareSerial.h>
const byte numChannels = 3;
SoftwareSerial channels[numChannels] = { {2,3}, {4,5}, {6,7} };
void setup() {
// put your setup code here, to run once:
for(byte x = 0; x < numChannels; x++)
{
channels[x].begin(9600);
}
}
void loop() {
// put your main code here, to run repeatedly:
char buffer[255];
byte channelNumber = 0, i = 0;
if(Serial.available())
{
Serial.readBytesUntil('\n', buffer, sizeof(buffer));
if(buffer[0] >= '0' && buffer[0] <= '9')
{
// Convert the number at the start of the buffer to an integer
channelNumber = atoi(buffer);
// Scoot forward in buffer until we find the space
for(byte i = 0; i < sizeof(buffer); i++)
{
if(buffer[i] == ' ')
{
i++;
break;
}
}
// i is now the index of the space (or we ran off the end
if(i < sizeof(buffer))
{
channels[channelNumber].print(&buffer[i]);
}
}
}
}