Number of repeated strings

I have a list of parts, labeled A1 through A20, with some duplicates. I’m trying to develop a list of parts with quantities, so something like a bill of materials. I’m trying to use a C# script as found here:

But all I get is an error that “1. Error (CS1579): foreach statement cannot operate on variables of type ‘object’ because ‘object’ does not contain a public definition for ‘GetEnumerator’ (line 73)”

Any assistance would be greatly appreciated!

Right click on input > Set "List Access"
Right click on input > Type hint to “String”.
With that, you are saying that this parameter receives a list of strings, so your “x” param will be of type List(of String), instead object. By default is item access of type object.

2 Likes

That worked perfectly. Thank you. :slightly_smiling: