code: private static String getHeaderInfo(String name, String headerLine) {
          String[] fields = headerLine.split("[\t ]");
          for (String field : fields) {
              if (field.startsWith(name + "=")) {
                  String[] subfields = field.split("=");
                  return subfields[1];
              }
          }
          return null;
      }
docs: Get information from a Wig header line.
  
  @param name          Name of the information, e.g.: span, chrom, step,...
  @param headerLine    Header line where to search that information
  @return              Value of the information