I am getting a JSON response with JSONArray having leading zeros. Example, registrationnumber = [\"0000012345\", \"0000001234\", \"000123456\"] I want to remove
registrationnumber = [\"0000012345\", \"0000001234\", \"000123456\"]
To convert to a number just multiply by 1. You should read the docs: https://github.com/intuit/karate#type-conversion
* def data = ["0000012345", "0000001234", "000123456"] * def nums = karate.map(data, function(x){ return parseInt(x) }) * match nums == [12345, 1234, 123456]