Skip to content

Commit

Permalink
Trim space from the index value of SST record
Browse files Browse the repository at this point in the history
  • Loading branch information
shakinm committed Jul 15, 2020
1 parent bb228df commit 2c1538a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion worksheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/xml"
"fmt"
"strconv"
"strings"
)

type Worksheet struct {
Expand Down Expand Up @@ -48,7 +49,7 @@ type Col struct {

func (c *Col) GetString() string {
if c.T == "s" {
idx, _ := strconv.Atoi(c.V.Value)
idx, _ := strconv.Atoi(strings.TrimSpace(c.V.Value))

if idx > len(c.Row.Worksheet.Workbook.Xlsx.SST.SSTitems) {
fmt.Println("out of range SST")
Expand Down

0 comments on commit 2c1538a

Please sign in to comment.