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

7 lines
150 B
Text
Raw Permalink Normal View History

2016-12-05 23:44:36 +01: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