help string comparison indxof

Good evening, I created a sketch that is to receive a get request from php with curl. he has to find a string in the get request. this is my code:

#include <SPI.h>
#include <Ethernet.h>
#include <WString.h>

byte mac[] = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED};

IPAddress ip(192, 168, 0, 177);

EthernetServer server(90);

void setup()
{
Serial.begin(9600);
Ethernet.begin(mac, ip);
server.begin();
Serial.print("server is at ");
Serial.println(Ethernet.localIP());
}

void rispondi(String risposta, EthernetClient ethclient)
{
	ethclient.println("HTTP/1.1 200 OK");
	ethclient.println("Content-Type: text/html");
	ethclient.println("Connection: close");// the connection will be closed after completion of the response
	ethclient.println("Refresh: 5");// refresh the page automatically every 5 sec
	ethclient.println();
	ethclient.println("<!DOCTYPE HTML>");
	ethclient.println("<html><body>");
	ethclient.println(risposta);
	ethclient.println("</body></html>");
}

void loop()
{
	String result = String();
	String prova = String();
	char c;
	EthernetClient client = server.available();
	if (client)
	{
	Serial.println("new client");
	boolean currentLineIsBlank = true;
	boolean sentHeader = false;
	while (client.connected())
	{
		if (client.available())
		{
			while(client.available())
			{
				char c = client.read();
			    result += c;
			    if(c == '\n')
			    {
			    	break;
			    }
			}
		}
		
		int on = result.lastIndexOf('pin13=on');
		int off = result.lastIndexOf('pin13=off');

        //rispondi(result, client);//debug
		if(on > 0)
		{
			digitalWrite(13, LOW);
			rispondi("ON", client);
		}
		if(off > 0)
		{
			digitalWrite(13, LOW);
			rispondi("OFF", client);
		}
		break;

		}

	}
	delay(1);
	client.stop();
	Serial.println("client disconnected");
}

the script writes always on even if the request is off, can you help?

int on = result.lastIndexOf('pin13=on');

I don't use or like Strings, but I'm pretty sure those should be double quotes.

thanks for the reply, with double quotes not work the same

The lastIndexOf() method is designed to find a specific character in a string, not a multi-character substring. Check the strstr() method of the String class.

Check the strstr() method of the String class.

The String class doesn't have a strstr() method.