From 6a276445b275090d9621796a25bf78b3c5dba499 Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 17 Mar 2019 22:42:43 +0300 Subject: [PATCH] 5) Row.ColExact(int)(string) when we need not to output duplicates of merged cells --- row.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/row.go b/row.go index 3100394..0908172 100644 --- a/row.go +++ b/row.go @@ -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)