class NMEA {

    @NonNull
    static String cleanNmea(@NonNull String nmea) {
        // Remove anything before $
        final int sentenceStart = nmea.indexOf('$');
        if (sentenceStart > 0) {
            nmea = nmea.substring(sentenceStart);
        }
        // Trim whitespace and \0
        return nmea.trim();
    }

}