serializerValue

This commit is contained in:
Mike Phares 2023-03-07 10:46:28 -07:00
parent bb857211e9
commit 6788a464ce

View File

@ -145,7 +145,9 @@ public class FromIQS
logistics.DateTimeFromSequence.Ticks logistics.DateTimeFromSequence.Ticks
}; };
string[] pair; string[] pair;
string safeValue;
string[] segments; string[] segments;
string serializerValue;
foreach (string line in logisticLines.Split(new string[] { Environment.NewLine }, StringSplitOptions.None)) foreach (string line in logisticLines.Split(new string[] { Environment.NewLine }, StringSplitOptions.None))
{ {
segments = line.Split('\t'); segments = line.Split('\t');
@ -158,7 +160,9 @@ public class FromIQS
pair = segment.Split('='); pair = segment.Split('=');
if (pair.Length != 2 || pair[0].Length < 3) if (pair.Length != 2 || pair[0].Length < 3)
continue; continue;
_ = stringBuilder.Append('"').Append(pair[0].Substring(2)).Append('"').Append(':').Append('"').Append(pair[1]).Append('"').Append(','); serializerValue = JsonSerializer.Serialize(pair[1]);
safeValue = serializerValue.Substring(1, serializerValue.Length - 2);
_ = stringBuilder.Append('"').Append(pair[0].Substring(2)).Append('"').Append(':').Append('"').Append(safeValue).Append('"').Append(',');
} }
if (stringBuilder.Length > 0) if (stringBuilder.Length > 0)
_ = stringBuilder.Remove(stringBuilder.Length - 1, 1); _ = stringBuilder.Remove(stringBuilder.Length - 1, 1);