Better HN
topnewbestaskshowjobs
Log inSign up

ghanrt

8 karma · joined Mar 22, 2021 (5y ago) · 1 submissions

Submissions

comment 5y ago · link · parent

It is. Apart from ++index, this is literally the same as:

  let ch = if index < strlen then str.charAt(index) else 0
Eminently readable and less boring than long if/else chains in Python.