RosettaCodeData/Task/String-matching/Jq/string-matching-2.jq

7 lines
150 B
Plaintext

# index/1 returns the index or null,
# so the jq test "if index(_) then ...." can be used
# without any type conversion.
"abcd" | index( "bc")
#=> 1