1 The `chr()` function converts each given numeric value into a character 2 and returns the resulting string, e.g. passing 97, 98 and 99 will yield 3 the string `abc`. 4 5 Negative numeric values and values which cannot be converted to integers 6 are treated as `0`, values larger than `255` are capped to `255`. 7 8 The resulting string will have the same length as the amount of arguments 9 passed to the `chr()` function. 10 11 -- Testcase -- 12 {% 13 printf("%.J\n", [ 14 chr(), 15 chr(97, 98, 99), 16 chr(-1, false, null, [], {}, "0x41", 66.5, 1000) 17 ]); 18 %} 19 -- End -- 20 21 -- Expect stdout -- 22 [ 23 "", 24 "abc", 25 "\u0000\u0000\u0000\u0000\u0000AB˙" 26 ] 27 -- End --
This page was automatically generated by LXR 0.3.1. • OpenWrt