Serial.funduntil()

void setup()
{
  Serial.begin(9600);
}
void loop()
{
  if(Serial.available())
  {if(Serial.findUntil("like","do"))
  Serial.println("found");
  else
  Serial.println("not found");
  }}

input:like do like actuall output: found not found found

expected output: found

because in that bunch of stream after the terminator string "do"it should not read next coming string.am i right.

http://arduino.cc/en/Serial/FindUntil

i have read that link what there said is

Serial.findUntil() reads data from the serial buffer until a target string of given length or terminator string is found.

here even after reading my terminator string"do".it continues reading .thats little confusing

Please spent some time to get a proper layout of your code that makes it far more readable. Proper indentation can be done by pressing CTRL-T in the IDE Add spaces and empty lines to separate logic blocks.

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if (Serial.available() > 0)
  { 
    if ( Serial.findUntil("like","do") )
    {
       Serial.println("found");
    }
    else
    {
      Serial.println("not found");
    }
  }
}

Be aware, this is the same sketch but not readable. The compiler does not need spaces, we humans do.

void setup(){Serial.begin(9600);}void loop(){if(Serial.available()>0){if(Serial.findUntil("like","do")){Serial.println("found");}else{Serial.println("not found");}}}