Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { /** Returns the talker ID and sentence ID as a single String, ex: "GPGGA". */ public static String getType(String nmeaSentence) { if (nmeaSentence != null && !nmeaSentence.isEmpty() && nmeaSentence.startsWith("$")) { return nmeaSentence.substring(1, 6); } else { return "Unknown"; } } }