Is there a way to try parse a Char into an Int?

Is there something like bool TryParse(char someint, out int someOtherInt) in Arduino?

If it is, in what library i can find it?

I found some examples to test Strings that way, but i personaly preffer check it directly, specialy because i’m taking input from the console

Arduino UNO

Windows 10

Here is the code:

void setup() {                
  Serial.begin(9600);
}

void loop() {
  if (Serial.available()) 
  {
    recvOneChar();
    showNewData();
    /*byteRead = someInt = Serial.read();
    Serial.write(byteRead);
    Serial.print("I received: ");
    Serial.write(someInt);
    Serial.print(" this has an ASCII value of ");
    Serial.println(someInt,DEC);*/
    if(Serial.parseInt()){
      if(((someInt) > 0) && ((someInt) < 89))
      {
        KeyNotesNode.add(someInt-48);
        Serial.print("It is a number!");
        Serial.print(someInt-48);
      }
    }
    Serial.println("");
    
  }

int atoi(const char *str)

Serial.read() only returns a char, so String functions aren't going to always work. If you are reading a single character, the only numeric values you can read are the digit characters '0' through '9'. To make an int:

   char c;
   int num;

  if (Serial.available()) {
     c = Serial.read()'
     num = (int) (c - '0');
     // whatever...
   }

So, if you touch the '5' key, c will equal 53. Since an ASCII zero is 48: num = (int) c - '0'; num = 53 - 48; num = 5;

If you want numbers greater than 9, you need to read the data from Serial.read() into a char array, add the null character at the end of the array, and then call atoi() to convert from ASCII to int.

Is there anyway to filter out any non-number char from him's origin?

Check isdigit().