با این کد میتونی او ن قسمت رو جدا کنی
کافیه به عنوان یک تابع بنویسیش و صداش بزنی
کد:
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
String code = "IPD,0,10:arduino.ir+" ;
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(9, 19);
Serial.println(number);
}
void loop() {
// put your main code here, to run repeatedly:
}