public static String extractFromDataMatrix(String code){
  if (code.length() < 16) {
    return null;
  }
  if (code.startsWith("01")) {
    return code.substring(2,16);
  }
  return null;
}

public static String extractFromDataMatrix ( String code ) { if ( code . length ( ) < 16 ) { return null ; } if ( code . startsWith ( "01" ) ) { return code . substring ( 2 , 16 ) ; } return null ; }
extracts a gtin from a gs1 datamatrix formatted bar code .
