21
0
Fork 0

5) Row.ColExact(int)(string) when we need not to output duplicates of merged cells

This commit is contained in:
Ivan 2019-03-17 22:42:43 +03:00
parent 10ff2752d9
commit 6a276445b2
1 changed files with 11 additions and 0 deletions

11
row.go
View File

@ -35,6 +35,17 @@ func (r *Row) Col(i int) string {
return ""
}
//ColExact Get the Nth Col from the Row, if has not, return nil.
//For merged cells value is returned for first cell only
func (r *Row) ColExact(i int) string {
serial := uint16(i)
if ch, ok := r.cols[serial]; ok {
strs := ch.String(r.wb)
return strs[0]
}
return ""
}
//LastCol Get the number of Last Col of the Row.
func (r *Row) LastCol() int {
return int(r.info.Lcell)