Problems with String class?

Hello,

I try to run a example (ESP8266 - I2C - Arduino)

when i send a i2c paket to the due ..freeze....

on the mega working well.

  if (s.startsWith("/getByte", 0))
  {
    int indexStart = s.indexOf('<');
    int indexEnd = s.indexOf('>');
    if (indexStart > 0 and indexEnd > indexStart)
    {
      int i = s.substring(indexStart + 1 , indexEnd).toInt();
      return i;
    }
    return 0;

  }

when this part is commented out its not freezing

have the due problems with this class ? String() - Arduino Reference

have you confirmed that you are even getting a string at all ?

dont ask me why.. but standalone it works...

String message = "/getByte|a<1234>'0'";


void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);               //set serial baud rate

}

int getIntParamValue(String s)
{
  if (s.startsWith("/getByte", 0))
  {
    int indexStart = s.indexOf('<');
    int indexEnd = s.indexOf('>');
    if (indexStart > 0 and indexEnd > indexStart)
    {
      int i = s.substring(indexStart + 1 , indexEnd).toInt();
      return i;
    }
    return 0;

  }
  return 0;
}

void loop() {

Serial.println(getIntParamValue(message));
delay(100);
}

returns 1234