Reading a string from serial AFTER inserting a certain char into the port

Hello everyone,
Im supposed to type "0" and then when the serial reads it, it should store the entire string that is coming after that 0 was entered.
I dont know what the size of this string is.
Here's my starter code:

String value;
if (Serial.available() && Serial.read() == '0') {
         while (Serial.available() == 0) {
    }
    if (Serial.available() > 1  ) {
         int h=Serial.available();    
for (int i=0;i<h;i++){
      value+=(char) Serial.read();
         }
}
    Serial.println(value);

value="";

The problem here is that it keeps looping in an infinite way and I dont know how else to put it. Maybe its a problem of setting the conditions right perhaps and i dont know how to do that..

It is easier to put a marker at the end of the string being send such that everything being sent is captured until the marker is received. There are examples of serial code available that have both start and end of data markers.

Pressing return or newline will terminate do:

do 
     {
        char c = Serial.read();
        value += c;
      } while  (c != '\r' || c!='\n') ;

<...> //stuff

It works now. I just had to add a delay after obtaining the zero to wait for the user to type whatever they need to insert