Save and restore settings on /from SD card

Hello all!
The main idea is to have web interface to configure LAN settings.
i have to write LNA settings to SD card in text file(mac,ip) it's work ok.
i need to read these settings and put it in Ethernet.begin(mac, ip);
i read from text file ip address {192,168,100,155} but it text. in function Ethernet.begin(mac, ip); it use byte variables. the problem is how to convert string {192,168,100,155} to byte value that will work function Ethernet.begin(mac, ip);

can you help me? thank you in advance.

the problem is how to convert string {192,168,100,155} to byte value that will work function Ethernet.begin(mac, ip);

If you really have a string (not a String), strtok() and atoi() will be useful functions. If you have a String, don't.

it finally i have like in this sample
String str="";
byte ip;
str="{192,168,100,155}";

now i need to convert str to ip.
how it can be done?

how it can be done?

The String class is fairly well documented. Look at the documentation your self.

Or, get smarter:

byte ipAdd[4];
char *ipStr = "192,168,100,155";
char *pToken = strtok(ipStr, ",");
if(pToken)
{
   ipAdd[0] = atoi(pToken);
   pToken = strtok(NULL, ","); // Keep parsing same string
   if(pToken)
   {
      ipAdd[1] = atoi(pToken);
      pToken = strtok(NULL, ","); // Keep parsing same string
      if(pToken)
      {
         ipAdd[2] = atoi(pToken);
         pToken = strtok(NULL, ","); // Keep parsing same string
         if(pToken)
         {
            ipAdd[3] = atoi(pToken);
         }
      }
   }
}

thank you!