{"id":20816538,"url":"https://github.com/icarogabryel/update-at-indexes","last_synced_at":"2025-03-12T05:40:44.169Z","repository":{"id":101917940,"uuid":"562309803","full_name":"icarogabryel/update-at-indexes","owner":"icarogabryel","description":"In this repository you will find extention functions to Array Class that provides tools to update a slice of a array using another one.","archived":false,"fork":false,"pushed_at":"2022-11-06T05:36:18.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-18T15:54:21.432Z","etag":null,"topics":["array","array-manipulations","array-methods","arraylist","index","indexing","kotlin","kotlin-language","slice","slicing","update"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/icarogabryel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-05T23:42:52.000Z","updated_at":"2024-04-05T23:04:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"de09347c-7c37-49ca-8848-34665f69ef6e","html_url":"https://github.com/icarogabryel/update-at-indexes","commit_stats":null,"previous_names":["icarogabryel/update-at-indexes"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icarogabryel%2Fupdate-at-indexes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icarogabryel%2Fupdate-at-indexes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icarogabryel%2Fupdate-at-indexes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icarogabryel%2Fupdate-at-indexes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icarogabryel","download_url":"https://codeload.github.com/icarogabryel/update-at-indexes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243165502,"owners_count":20246721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["array","array-manipulations","array-methods","arraylist","index","indexing","kotlin","kotlin-language","slice","slicing","update"],"created_at":"2024-11-17T21:34:56.490Z","updated_at":"2025-03-12T05:40:44.147Z","avatar_url":"https://github.com/icarogabryel.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Update At Indexes function for Arrays In Kotlin\n\n## 1. Definition\n\nIn this repository you will find extention functions to Array Class that provides tools to update a slice of a array using another one.\n\n## 2. Examples\n\nLets begin with a main array caled `list` and other that will have the values you want to update in the main called `newValues`.\n\n    val list = arrayOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n    val newValues = arrayOf(-3, -4, -5, -6, -7)\n\nthe initial values in `list` are:\n\n\u003e 1, 2, 3, 4, 5, 6, 7, 8, 9, 10\n\nYou can call the function passing a `IntRange` as first parameter and the array that will update the main array as second parameter.\n\n    list.updateAtIndexes(2..6, newValues)\n\nThe `IntRange` will represent the first and last indexes of the main array that will be updated. In this case, the `IntRange` is from 2 to 6, so the values in the main array from index 2 to 6 will be updated with the values in `newValues` array.\n\nThe new values of `list` are:\n\n\u003e1, 2, -3, -4, -5, -6, -7, 8, 9, 10\n\nYou also can call the function passing another function as parameter, where all the values inside the passed range will be update according to this one.\n\n    list.updateAtIndexes(8..9) {0}\n\nThen, the new values of `list` are:\n\n\u003e 1, 2, 3, 4, 5, 6, 7, 8, 0, 0\n\nAn usefull way to use this functions is with slice function to update a slice of the main list with a slice of the updating list like the exemple bellow:\n\n    list.updateAtIndexes(4..6,  update.slice(2..4).toTypedArray())\n\nThe values of `list` are:\n\n\u003e 1, 2, 3, 4, -5, -6, -7, 8, 9, 10\n\nIn `.kt` file you will find examples.\n\n## 3. Implementaion\n\nYou can do the implementation of this functions simply declaring it in your code.\n\n## 4. Conclusion\n\nThis functions can help you in a lot of situations where you need to update a slice of a array with a already existing array.\n\nWe hope this can help you in your projects. If you have any question, please, contact us.\n\n## 5. Credits:\n\n- [Ícaro Gabryel](https://github.com/icarogby)\n- [Wesley Vitor](https://github.com/alpha11000)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficarogabryel%2Fupdate-at-indexes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficarogabryel%2Fupdate-at-indexes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficarogabryel%2Fupdate-at-indexes/lists"}