-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separator output bug #126
Comments
Hi Brian,
Another possibility that I see is to use two templates combined with the use of
In PrintFollowers you simply add the comma directly to each even parameter print. Please notice that I am using slightly modified attribute names in the code above and '$' as delimiters 😅 . I hope this helps. |
Thank you for your response @chaami If what you say is true, then there should have been a separator between all items in the list, but there isn't; however, notice that there aren't separators for items not output for items at the beginning of the list, but once an item is output (in my example, the second item), then ST outputs a separator for every subsequent item. So, clearly ST knows that it shouldn't be outputting separators at the beginning of the list, but once it does output an item it forgot to suppress separators for items not output. I hadn’t thought about using LINQ for filtering. Thank you for that! |
Hi @BrianCatlin,
Actually if print the length of the list with
Should yield to 3. |
Thanks! |
Glad I could help... |
When iterating over a list, separators for items skipped at the beginning of a list are not output, but once an item in the list is output, separators are output for subsequent items, even when items are skipped. The following C# code illustrates this. The output is: "2 is even," (note the trailing comma separator, but there isn't a comma before the 2, for the first skipped item)
The text was updated successfully, but these errors were encountered: