how to go from string to integer in processing? or how to concatenate integers? [closed]

2

Good I need to take the value of the string cade and pass it to an integer to make operations with it, there goes the code I appreciate your help

    import processing.net.*; 

    Client c; 
    String data;
    int r=1;
    int l1=0;
    String cade;

    void setup() { 

    size(200, 100);
    background(153);
    line(0, 0, width, height);
      c = new Client(this, "xxxxxxxxxxxx", 80);  // Connect to server on port 80 
      c.write("GET / HTTP/1.0\n");  // Use the HTTP "GET" command to ask for a webpage
      c.write("Host: my_domain_name.com\n\n"); // Be polite and say who we are
    } 

    void draw() {
      while (c.available() > 0) { 

        println(c.available());// If there's incoming data from the client...
        data += c.readString();   // ...then grab it and print it 
        println(data);

        l1 = data.length();

           if(l1>214){
         cade=data.substring(89,98); 

       r= int(cade.charAt(3))-48;
       println(r + "ok" + cade);
       println(Integer.parseInt(cade));
     }

      }


    }
    
asked by Lorenzo 04.05.2017 в 10:05
source

0 answers