Determine if a string has all unique characters: Difference between revisions

(→‎{{header|Vlang}}: Rename "Vlang" in "V (Vlang)")
(→‎{{header|jq}}: simplify)
Line 2,366:
def hex:
def stream:
recurse(if . >= 016 then ./16|floor else empty end) | . % 16 ;
if type=="string" then explode[0] else . end
| if[stream] .| == 0 then "0"reverse
| map(if . < 10 then 48 + . else [stream]. |+ reverse87 end) | .[1:]implode ;
| map(if . < 10 then 48 + . else . + 87 end) | implode
end;
 
def lpad($len): tostring | " " * ($len - width) + .;
2,469

edits