Convert String From Serial Data to Numerical Value

Thanks for that, I tried:

      int value = atoi(sensorstring);
      Serial.println(value);

error: cannot convert 'String' to 'const char*' for argument '1' to 'int atoi(const char*)'

Is it because it's reading sensorstring as '1'?