[jq] Check whether a string ends with a suffix

Created on November 30, 2026

endswith returns true when the input string ends with the supplied suffix. This example checks whether report.csv ends in .csv.

echo '"report.csv"' | jq 'endswith(".csv")'
true
jq