Skip to content

Copy some values from one ArrayList to another kotlin

I have list:

var skillsList: MutableList<ComplexModel> = mutableListOf()

ComplexModel contains (Name,Title,StartDate,Summarry)

I want to find better way to create new MutableList from skillsList but the new list have to get only Name and Title from the first.For the moment i`m with this solution but i wonder if there are better way to achieve this.

   val newArray: MutableList<SkillModel> = mutableListOf()

    for (skill in skillsList) {
        newArray.add(SkillModel(name =, title = skill.title))



var skills: List<SkillModel> = { SkillModel(,it.title) }