SmartCarApp/app/src/main/java/com/example/smartcarapp/SpeechToText.java
//Converts the string into an int if it contains meters and returns a 0 if it doesn't

Converts the string into an int if it contains meters and returns a 0 if it doesn't
Converts the string into an int if it contains meters and returns a 0 if it doesn ' t
public static int metersProcessing(String mqttMessage){
        String resultInt = mqttMessage.replaceAll("[^0-9]", "");
        int metersInt = 0;
        if(!resultInt.isEmpty()){
            metersInt = Integer.parseInt(resultInt);
        }
        return metersInt;
    }
public static int metersProcessing ( String mqttMessage ) { String resultInt = mqttMessage . replaceAll ( "[^0-9]" , "" ) ; int metersInt = 0 ; if ( ! resultInt . isEmpty ( ) ) { metersInt = Integer . parseInt ( resultInt ) ; } return metersInt ; }
Converts the string into an int if it contains meters and returns a 0 if it doesn't
Converts the string into an int if it contains meters and returns a 0 if it doesn ' t