Strings and byte for 74HC595n shift resistor

i am presently working on a shift resistor and was trying to get a string from serial monitor like "10110100"(basically arrangement of led's i want to light up). i converted an number(int) corresponding to the byte and got it to work with the shift resistor. i am having problems with sending a string and converting it as it is to byte and then int.

//Pin connected to ST_CP of 74HC595
int latchPin = 8;
//Pin connected to SH_CP of 74HC595
int clockPin = 12;
////Pin connected to DS of 74HC595
int dataPin = 11;


String inString = ""; 
void setup() {
  pinMode(latchPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  Serial.begin(9600);
}

void loop() 
{
    int inChar = Serial.read();
    if (isDigit(inChar)) //making the string from serial port.
    {
      inString += (char)inChar; 
    
    if(inString.length() ==8)//defining string to be 8 bits long.
    {
     int x=int(byte(inString.toInt()));
    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, MSBFIRST, x);  //sending the value to the shift resistor
    digitalWrite(latchPin, HIGH);
    Serial.println(x);//for conformation getting the value on serial monitor
    inString="";
    }
    }
   
}

may by the problem is in the part "int x=int(byte(inString.toInt()));"

    if(inString.length() ==8)//defining string to be 8 bits long.

When you know exactly what size collection of characters to receive, using a String object to do so is going to (soon) bite you in the ass. Learn to use char arrays.

     int x=int(byte(inString.toInt()));

Make up your mind what the hell you want. Converting a String that contains what you think is a binary representation o f a value (it does not) to an int, casting that to a byte, casting that to an int, and storing that in an int is a lot of silly shuffling of bits.

You are not sending a collection of characters that the toInt() method knows how to handle. It does not accept a base argument that defines what base the value in the string is in.

You will need to use strtoul() on a char array (extracted from the String, if you are too lazy to use char arrays properly), and specify the base as 2. Ditch the silly casting.