
نوشته اصلی توسط
solxsado
void setup() {
Serial.begin(9600);
String code = ("GET /device=1124&code=10012&name=10012&value=1022 HTTP/1.1Host: 192.168.4.1Connection: close") ;
code.replace("GET /", "");
int index = code.indexOf("HTTP/1");
String output = code.substring(1, index-1);
Serial.println(output);
}
void loop() {
// put your main code here, to run repeatedly:
}
با اجازه من یه کم کد رو تغییر دادم
مرسیییییی
خیلی تریک خوبی بود به عقلم نمی رسید 
فقط باید یه از 0 شروع بشه نه 1 درسته ؟
کد:
void setup() {
Serial.begin(9600);
String code = ("GET /device=1124&code=10012&name=10012&value=1022 HTTP/1.1Host: 192.168.4.1Connection: close") ;
code.replace("GET /", "");
int index = code.indexOf("HTTP/1");
String output = code.substring(0, index-1);
Serial.println(output);
}
void loop() {
// put your main code here, to run repeatedly:
}