Trim strings and only include them if the right length

This commit is contained in:
Matt Nadareski
2024-11-20 15:48:12 -05:00
parent 5fe4d81fa4
commit 8f70c50a48

View File

@@ -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;
}