# Assert contains multiple strings

**URL:** <https://community.postman.com/t/assert-contains-multiple-strings/7383>\
**Category:** Help Hub\
**Tags:** tests, responseassertion\
**Created:** [August 23, 2019, 6:04pm UTC](https://community.postman.com/t/assert-contains-multiple-strings/7383 "2019-08-23T18:04:42Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![singhsivcan](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/singhsivcan/32/1595_2.png) [@singhsivcan](https://community.postman.com/u/singhsivcan)\
**Post date:** [May 31, 2021, 6:52am UTC](https://community.postman.com/t/assert-contains-multiple-strings/7383/5 "2021-05-31T06:52:58Z")

</div>

I think it can be quickly done using [Array.some](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/some) and a little tweaking of the test case:

```auto
pm.test("Verify any of the following strings", function () {
  let expectedStrings = ["1110", "1119"];
  responseText = pm.response.text();

  const hasAnyExpectedString = expectedStrings.some((s) => responseText.includes(s));
  pm.expect(hasAnyExpectedString).to.be.true;
});

```

---

_[View the full topic](https://community.postman.com/t/assert-contains-multiple-strings/7383)._
