AT Command Response to Variable

Hi,
I'm a newbie. How can I store the response from my AT commands as a Variable?

I've 3 AT commands, for which I would like to store the response in a single variable.

Serial1.println("AT+CIMI");
Serial1.println("AT+CGSN=2");
Serial1.println("AT+CGPADDR);

AT+CIMI will return something like:
222107701772423
OK

AT+CGSN=2 will return something like:
+CGSN:123456706151000
OK

AT+CGPADDR will return something like:
+CGPADDR:0,10.254.200.194
OK

I would like to store in the following format in a variable:
222107701772423;123456706151000;10.254.200.194

I tried the below and it didn't work as expected. Please help.

  while (Serial1.available() > 0)
  {
    Serial.write(Serial1.read());
  }
}

I've 3 AT commands, for which I would like to store the response in a single variable.

Why? Storing the response to each one in a different variable makes sense. Storing the output from all three in the same variable does not.

I tried the below and it didn't work as expected.

Clearly, it is your expectations that are wrong. However, as we have no idea what you expected that code to do, we can't help you align your expectations with reality.

If you don't like to help, you could have just not replied to this post.

You asked for help getting from point A to point B. You have defined where point B is, but not where point A is. It may be that you can't get there from here.

If you don't want to answer questions, like "What does that code actually do, and how does that differ from what you expected?", why did you bother posting?