How can i add List<List> parameter to extension

i want to get List<List> (nested list) parameter.
for get csv list

how can i get ?


fun findIndex(table : YailList<YailList>, thing : String, ignoreCase : Boolean) : Int {

        }

See this please:

https://community.kodular.io/t/how-to-switch-screens-correctly/9705?u=smart_dr

I asked about getting nested list parameters from outside in extension codes. Why did you send this?

Sorry. My mistake.

1 Like

Do you mean getting a YailLists from a YailList ??

public void Idk(YailList list){
    for(Object object : list.toArray()){ // Here, i am iterating over each items present in the list 
        if(object instanceof YailList){
            // Then the object is a YailList
        }
    }
}
1 Like

thank youu :slight_smile:

 @SimpleFunction
    fun findIndex(csvList : YailList, thing : String, ignoreCase : Boolean) : Int {

        var returnInt = -1

        csvList.forEachIndexed { index, item->
            if (item is YailList) {
                for (ii in item) {
                    val searchItem = if (ignoreCase) thing.lowercase() else thing
                    if (searchItem == ii.toString().lowercase()) {
                        returnInt = index
                    }
                }
            }

        }

        return returnInt
    }
1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.