func (f Field) GetSubFields(filter string) []SubField {
	values := []SubField{}
	for _, sub := range f.SubFields {
		if strings.Contains(filter, sub.Code) {
			value := SubField{
				Code:  sub.Code,
				Value: sub.Value,
			}
			values = append(values, value)
		}
	}
	return values
}
GetSubFields returns an array of subfields that match the set of subfields
indicated in the filter string. "filter" is a plain string, like "abu", to
indicate what subfields are to be returned.
package marc
import (
	"bytes"
	"errors"
	"fmt"
	"strings"
)
type Field struct {
	Tag        string      
	Value      string      
	Indicator1 string      
	Indicator2 string      
	SubFields  []SubField  
}
type SubField struct {
	Code  string
	Value string
}
func MakeField(tag string, data []byte) (Field, error) {
	f := Field{}
	f.Tag = tag
	if strings.HasPrefix(tag, "00") {
		f.Value = string(data)
		return f, nil
	}
	if len(data) > 2 {
		f.Indicator1 = string(data[0])
		f.Indicator2 = string(data[1])
	} else {
		return f, errors.New("Invalid Indicators detected")
	}
	if len(data) < 4 {  
		return f, errors.New("Bad SubFields length")
	}
	for _, sf := range bytes.Split(data[3:], []byte{st}) {
		if len(sf) > 1 {
			f.SubFields = append(f.SubFields, SubField{string(sf[0]), string(sf[1:])})
		}
	}
	return f, nil
}
func (f Field) IsControlField() bool {
	return strings.HasPrefix(f.Tag, "00")
}
func (f Field) Contains(str string) bool {
	str = strings.ToLower(str)
	if f.IsControlField() {
		return strings.Contains(strings.ToLower(f.Value), str)
	}
	for _, sub := range f.SubFields {
		if strings.Contains(strings.ToLower(sub.Value), str) {
			return true
		}
	}
	return false
}
func (f Field) String() string {
	if f.IsControlField() {
		return fmt.Sprintf("=%s  %s", f.Tag, f.Value)
	}
	str := fmt.Sprintf("=%s  %s%s", f.Tag, formatIndicator(f.Indicator1), formatIndicator(f.Indicator2))
	for _, sub := range f.SubFields {
		str += fmt.Sprintf("$%s%s", sub.Code, sub.Value)
	}
	return str
}