fix the redundant space when convert to pivot table with multiple row selector

This commit is contained in:
haib0 2023-12-28 16:52:39 +08:00 committed by GitHub
parent d965b1faca
commit b915617e3a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

@ -62,7 +62,9 @@ namespace SqlSugar
foreach (DataRow row in table.Rows)
{
var json =row[firstName];
var list = json.ToString().TrimStart('{').TrimEnd('}').Split(',').Select(it=>it.Split('=')).ToList();
var list = json.ToString().TrimStart('{', ' ').TrimEnd('}', ' ')
.Split(new[] { ", " }, StringSplitOptions.None)
.Select(it => it.Split(new[] { " = " }, StringSplitOptions.None)).ToList();
foreach (var item in Regex.Split(firstName, UtilConstants.ReplaceKey))
{
var x = list.First(it => it.First().Trim() == item.Trim());

View File

@ -62,7 +62,9 @@ namespace SqlSugar
foreach (DataRow row in table.Rows)
{
var json =row[firstName];
var list = json.ToString().TrimStart('{').TrimEnd('}').Split(',').Select(it=>it.Split('=')).ToList();
var list = json.ToString().TrimStart('{', ' ').TrimEnd('}', ' ')
.Split(new[] { ", " }, StringSplitOptions.None)
.Select(it => it.Split(new[] { " = " }, StringSplitOptions.None)).ToList();
foreach (var item in Regex.Split(firstName, UtilConstants.ReplaceKey))
{
var x = list.First(it => it.First().Trim() == item.Trim());

View File

@ -62,7 +62,9 @@ namespace SqlSugar
foreach (DataRow row in table.Rows)
{
var json =row[firstName];
var list = json.ToString().TrimStart('{').TrimEnd('}').Split(',').Select(it=>it.Split('=')).ToList();
var list = json.ToString().TrimStart('{', ' ').TrimEnd('}', ' ')
.Split(new[] { ", " }, StringSplitOptions.None)
.Select(it => it.Split(new[] { " = " }, StringSplitOptions.None)).ToList();
foreach (var item in Regex.Split(firstName, UtilConstants.ReplaceKey))
{
var x = list.First(it => it.First().Trim() == item.Trim());