0

I currently have an object

user

this object has multiple propeties under which

user.id //(int)
user.firstName //(string)
user.lastName //(string)
user.phone //(int)
user.email //(string)

I want to apply a string method to all of the string in this object, How do I loop trough these, so that all strings get effected, but not the ints?

I can of course manually check aplly the method to all string properties, but I'd prefer it if I could use an

foreach

loop.

0 Answers0