Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

keyset

java collections – keyset() vs entrySet() in map

August 23, 2023 by Tarik

Every call to the Iterator.next() moves the iterator to the next element. If you want to use the current element in more than one statement or expression, you have to store it in a local variable. Or even better, why don’t you simply use a for-each loop? for (String key : map.keySet()) { System.out.println(key + … Read more

Categories java Tags collections, hashmap, java, keyset, linkedhashmap Leave a comment

lua: retrieve list of keys in a table

April 29, 2023 by Tarik

local keyset={} local n=0 for k,v in pairs(tab) do n=n+1 keyset[n]=k end Note that you cannot guarantee any order in keyset. If you want the keys in sorted order, then sort keyset with table.sort(keyset).

Categories lua Tags keyset, lua, lua-table Leave a comment

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa