region.fields with sep
This commit is contained in:
parent
3eb65a2657
commit
d638015592
|
|
@ -28,8 +28,12 @@ func NewRegion(str string) *Region {
|
|||
}
|
||||
|
||||
func (r *Region) Fields() []string {
|
||||
return r.SepFields("|")
|
||||
}
|
||||
|
||||
func (r *Region) SepFields(sep string) []string {
|
||||
if r.fields == nil {
|
||||
r.fields = strings.Split(r.Str, "|")
|
||||
r.fields = strings.Split(r.Str, sep)
|
||||
}
|
||||
|
||||
return r.fields
|
||||
|
|
|
|||
Loading…
Reference in New Issue