# FAQ: How can I check that the last characters in a string contain a particular value?

**URL:** <https://connective.celigo.com/t/faq-how-can-i-check-that-the-last-characters-in-a-string-contain-a-particular-value/1186>\
**Category:** Integrator.io\
**Tags:** import, handlebars, netsuite\
**Created:** [February 12, 2021, 6:36pm UTC](https://connective.celigo.com/t/faq-how-can-i-check-that-the-last-characters-in-a-string-contain-a-particular-value/1186 "2021-02-12T18:36:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![courtneyjordan](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@courtneyjordan](https://connective.celigo.com/u/courtneyjordan)\
**Post date:** [February 12, 2021, 6:36pm UTC](https://connective.celigo.com/t/faq-how-can-i-check-that-the-last-characters-in-a-string-contain-a-particular-value/1186/1 "2021-02-12T18:36:52Z")

</div>

**Q:** I have a field, SellerSKU, that need to contain a particular value in the last 4 characters of the string. If the record’s field doesn’t contain that value, I want to identify those records, then replace them with another value. How can I do this?

**A:**   
**Identify these characters**  
In your import mapping, use this handlebars expression:

```
{{substring $.OrderItem.SellerSKU (subtract $.OrderItem[*].SellerSKU.length "4") $.OrderItem[*].SellerSKU.length}}
```

Note: Make sure you include a space between SellerSKU and ( and again between ) and $.

If you are using NetSuite, you would likely map to Internal ID, a unique number of an item record in NetSuite. However, if your SellerSKU is an item record, use “Items: Item (Name) instead of “Items: Item (Internal Id)”.

The substring command will return the length of your string, then the subtract will remove 4 characters, which will then serve as your starting index. The length command serve as your end index.

Thus, if you had a SellerSKU value of "A99Z-A14-QR-FBA", it would be it would be evaluated as   
= "-FBA"

**Replace these characters**

To replace these characters, you would use replace instead of subtract in the equation above:

```
replace $.OrderItem[*].SellerSKU "-FBA" ""
```
