-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
$s[1] versus $s[1:2] in strings #1520
Comments
I insist. This code is generic for strings and arrays in jq:
because slices syntax is identical for strings and arrays, but unlike Python
jq does not allow indexed acces to one character in strings:
|
You're right, it ought to work. EDIT: Hmmm, maybe not. There's no character type. Consider what |
What I'd like to do is add support for binary data, where binary data is represented as an array of integers 0..255 (naturally). Internally this would be efficient, but from a jq program's point of view it would be indistinguishable from an array of numbers (mostly; |
Strings do not allow indexed access: why $s[1] is not valid and equal to $s[1:2] in strings?
The text was updated successfully, but these errors were encountered: