print(contact.lastname,",", contact.firstname,",", contact.email,",", contact.phone)
The output is:
Polo , Marco , cam.com , 444-444-4444
I want:
Polo, Marco, cam.com, 444-444-4444
string.replace(" ,",",")
You can use the replace method to substitute " ,"
with ","
and then you have what you want.
Although, with your example, just do:
print(contact.lastname+",",contact.firstname+",",contact.email+",",contact.phone)
When you do print(v,w)
you automatically add a space. So if you do print(v,",",w)
you have the space you try to get rid of. If, instead, you do print(v+",")
then you have no space between the text in v and the comma.