Kotlin – Convert Map to/from Properties

In the post, we show how to convert ‘Kotlin Map to Properties’ and versus case ‘Properties to Kotlin Map’.

I. Kotlin – Convert Map to Properties

Use toProperties() method of Map class,
-> Method signature:


II. Kotlin – Convert Properties to Map

Iterate through Properties object by forEach or for-loop statement then manually use put(key: K, value: V) method of Map interface.


By grokonez | March 4, 2018.

Last updated on February 6, 2020.

Related Posts

Got Something To Say:

Your email address will not be published. Required fields are marked *