func (p *Prefix) Len() (length int) {
	length = len(p.Name)
	if len(p.User) > 0 {
		length = length + len(p.User) + 1
	}
	if len(p.Host) > 0 {
		length = length + len(p.Host) + 1
	}
	return
}
Len calculates the length of the string representation of this prefix.
package irc
import (
	"bytes"
	"strings"
)
const (
	prefix     byte = 0x3A  
	prefixUser byte = 0x21  
	prefixHost byte = 0x40  
	space      byte = 0x20  
	maxLength = 510  
)
func cutsetFunc(r rune) bool {
	return r == '\r' || r == '\n'
}
type Sender interface {
	Send(*Message) error
}
type Prefix struct {
	Name string  
	User string  
	Host string  
}
func ParsePrefix(raw string) (p *Prefix) {
	p = new(Prefix)
	user := indexByte(raw, prefixUser)
	host := indexByte(raw, prefixHost)
	switch {
	case user > 0 && host > user:
		p.Name = raw[:user]
		p.User = raw[user+1 : host]
		p.Host = raw[host+1:]
	case user > 0:
		p.Name = raw[:user]
		p.User = raw[user+1:]
	case host > 0:
		p.Name = raw[:host]
		p.Host = raw[host+1:]
	default:
		p.Name = raw
	}
	return p
}