bugfix:修复string没有空格的情况

This commit is contained in:
dingxiaowei
2022-09-07 07:10:27 +08:00
parent 37b382c9d4
commit 0cc4354906
11 changed files with 5 additions and 3 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ namespace ExcelTool
var descRow = sheet.GetRow(1);//读取注释 var descRow = sheet.GetRow(1);//读取注释
for (int j = 0; j < row.LastCellNum; j++) for (int j = 0; j < row.LastCellNum; j++)
{ {
string value = row.GetCell(j).ToString().Replace(" ", ""); string value = row.GetCell(j).ToString();
var descValue = descRow.GetCell(j) == null ? "" : descRow.GetCell(j).ToString(); var descValue = descRow.GetCell(j) == null ? "" : descRow.GetCell(j).ToString();
var array = value.Split(','); var array = value.Split(',');
if (array.Length != 2) if (array.Length != 2)
@@ -67,7 +67,7 @@ namespace ExcelTool
{ {
var cellValue = row.GetCell(j); var cellValue = row.GetCell(j);
if (cellValue != null) if (cellValue != null)
tableExcelRow.Add(row.GetCell(j).ToString().Replace(" ", "")); tableExcelRow.Add(row.GetCell(j).ToString());
else else
tableExcelRow.Add(""); tableExcelRow.Add("");
} }
+3
View File
@@ -1,6 +1,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
namespace ExcelTool namespace ExcelTool
{ {
@@ -87,6 +88,8 @@ namespace ExcelTool
//if (readOK) //if (readOK)
//{ //{
// ConsoleHelper.WriteInfoLine(newavList.ToString()); // ConsoleHelper.WriteInfoLine(newavList.ToString());
// var d = (newavList as avatarguideTestConfig).QueryById(1).ToList();
// ConsoleHelper.WriteInfoLine(d[0].gender);
//} //}
//else //else
//{ //{
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -47,7 +47,6 @@ D:\Study\github\ExcelTool\ExcelTool\bin\Debug\Spire.XLS.dll
D:\Study\github\ExcelTool\ExcelTool\bin\Debug\Microsoft.mshtml.dll D:\Study\github\ExcelTool\ExcelTool\bin\Debug\Microsoft.mshtml.dll
D:\Study\github\ExcelTool\ExcelTool\bin\Debug\Spire.Pdf.xml D:\Study\github\ExcelTool\ExcelTool\bin\Debug\Spire.Pdf.xml
D:\Study\github\ExcelTool\ExcelTool\bin\Debug\Spire.XLS.xml D:\Study\github\ExcelTool\ExcelTool\bin\Debug\Spire.XLS.xml
D:\Study\github\ExcelTool\ExcelTool\obj\Debug\ExcelTool.csprojAssemblyReference.cache
D:\Study\github\ExcelTool\ExcelTool\obj\Debug\ExcelTool.csproj.CoreCompileInputs.cache D:\Study\github\ExcelTool\ExcelTool\obj\Debug\ExcelTool.csproj.CoreCompileInputs.cache
D:\Study\github\ExcelTool\ExcelTool\obj\Debug\ExcelTool.csproj.CopyComplete D:\Study\github\ExcelTool\ExcelTool\obj\Debug\ExcelTool.csproj.CopyComplete
D:\Study\github\ExcelTool\ExcelTool\obj\Debug\ExcelTool.exe D:\Study\github\ExcelTool\ExcelTool\obj\Debug\ExcelTool.exe
Binary file not shown.
Binary file not shown.