Casting objects into string is not a solution here. For example if you have collection of \DateTime objects there is no way to cast it into string.