From 8f70c50a48c15b1abdb78f3180aaa433f75f49d0 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 20 Nov 2024 15:48:12 -0500 Subject: [PATCH] Trim strings and only include them if the right length --- SabreTools.Serialization/Wrappers/WrapperBase.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/SabreTools.Serialization/Wrappers/WrapperBase.cs b/SabreTools.Serialization/Wrappers/WrapperBase.cs index 86e3c386..eea75548 100644 --- a/SabreTools.Serialization/Wrappers/WrapperBase.cs +++ b/SabreTools.Serialization/Wrappers/WrapperBase.cs @@ -347,7 +347,15 @@ namespace SabreTools.Serialization.Wrappers // If we have a cached string greater than the limit if (cachedChars.Count >= charLimit) - sourceStrings.Add(new string([.. cachedChars])); + { + // Get the string from the cached characters + string cachedString = new([.. cachedChars]); + cachedString = cachedString.Trim(); + + // Only include trimmed strings over the limit + if (cachedString.Length >= charLimit) + sourceStrings.Add(cachedString); + } return sourceStrings; }