no class named .at [SOLVED WITH LOVE]

Getting a UDP msg, i convert the char into a string to search for some specific characters in the msg.

In this example im looking for the "capital letter L" because i need the next piece of information after
that capital L. which is an interger.

So the incoming UDP msg could look like this S0L1E0T1

I want to split them up, OR lookup the letter i need, so i can find the correct number.

  int size = udp.parsePacket();
  if (size > 0) {
    do
      {
        char* msg = (char*)malloc(size+1);
        int len = udp.read(msg,size+1);
        msg[len]=0;
        
        String inputMsg = String(msg);                            // switching to string mode
        for (unsigned int i=0;i < inputMsg.length(); i++)    // running through the string
        {
          if(inputMsg.at(i) == "L")                                  // looking for L
          {
            Serial.print("Found one : ");                           // Do stuff if L is found
            Serial.println(inputMsg.at(i);
            doStuff();
          }
        }
        
        
        Serial.print("received: '");
        Serial.print(msg);
        free(msg);
      }

However, im running into issues using the .at because clearly it's not supported,
but I'm coming from visual studio where i would #include to help me out here.

Not sure if char is able to work in this way, but it's fine anyway running on a mega and
have plenty of memory to spare.

Any ideas, also open for alternative solutions to find the number after a letter like that.

        String inputMsg = String(msg);                            // switching to string mode
        for (unsigned int i=0;i < inputMsg.length(); i++)    // running through the string
        {
          if(inputMsg.at(i) == "L")

It's rather silly to wrap an array of chars in a String instance, so you can test the individual characters in the array. Shitcan the stupid String class. Access the characters in the array.

PaulS:

        String inputMsg = String(msg);                            // switching to string mode

for (unsigned int i=0;i < inputMsg.length(); i++)    // running through the string
        {
          if(inputMsg.at(i) == "L")



It's rather silly to wrap an array of chars in a String instance, so you can test the individual characters in the array. Shitcan the stupid String class. Access the characters in the array.

Tell me how then... you are not being helpful, at all.

Just looking into that page nick posted a link to..

Tell me how then... you are not being helpful, at all.

Are you serious?

        for (unsigned int i=0;i < strlen(msg); i++)    // running through the string
        {
          if(msg[i] == "L")

// looking for L

PaulS:
Are you serious?

Yes, i was. Clearly i was unable to see the logic here.
So i really appreciate the zealous attitude often expressed by the senior members on this board.

PaulS:

        for (unsigned int i=0;i < strlen(msg); i++)    // running through the string

{
          if(msg[i] == "L")


// looking for L

But thank you, yes that is quite clear now.
Strange how i missed this, but it's obvious now that you show me.

Maybe it's the language barrier, but English is certainly not my native language.

thank you.