From 810139f5fc46b1002c0998379b18af3d2feffbb7 Mon Sep 17 00:00:00 2001 From: heiy <287789299@qq.com> Date: Thu, 10 Oct 2019 20:04:33 +0800 Subject: solve ending space missing --- cell.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cell.go b/cell.go index f9868de..ab42b72 100644 --- a/cell.go +++ b/cell.go @@ -229,7 +229,7 @@ func (f *File) SetCellStr(sheet, axis, value string) error { value = value[0:32767] } // Leading space(s) character detection. - if len(value) > 0 && value[0] == 32 { + if len(value) > 0 && (value[0] == 32 || value[len(value)-1] == 32) { cellData.XMLSpace = xml.Attr{ Name: xml.Name{Space: NameSpaceXML, Local: "space"}, Value: "preserve", -- cgit v1.2.1