کد:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
String code = "+CLIP:;09111111111;,161,;;,,;ailin;,0,," ;
int firstClosingBracket = code.indexOf(';');
// Serial.println("The First index of ; in the string " + code + " is " + firstClosingBracket);
int secondOpeningBracket = firstClosingBracket + 1;
int secondClosingBracket = code.indexOf(';', secondOpeningBracket);
// Serial.println("The Second index of the second ; in the string " + code + " is " + secondClosingBracket);
String number = code.substring(7, 18);
Serial.println(number);
}
void loop() {
// put your main code here, to run repeatedly:
}
اگه نسبت با ورژن کامندی که برات قبل فرستادم مقایسه کنی من به جای " ها ; گذاشتم چون کدم کامپایل نمی شد.