I have populated a list with a class. 

Here is the query which is filling the list of Customers:

```
List<Customers> customers = [Select Id, LegacyCustomerNo FROM Customer__c WHERE state__c = 'PA'];

```

Is there any method that will let me get all the Ids in a comma separated string?

Is it also possible to get all the values for legacycustomerno field in a comma separated string?