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

7 lines
150 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
# 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