I want to loop through a collection of items and append semicolon after each item.
Example Output values from mycollection:
5590
6063
1213
Expected Output: 5590;6063;1213
Below is my code.
for ($i = 0; $i -lt $myCollection.Count; $i++)
{
$cmID = $cmID + $myCollection[$i].Label + ";"
}
$cmID.Substring(0,$cmsID.Length-1) #This is to remove the last semicolon
Using above code, I am getting output as:
55905590;6063;1213
But I want the output as: 5590;6063;1213