# Removing last 2 characters from a string\[Uploading: Screenshot 2024-05-10 at 4.18.36 PM.png…\]()

**URL:** <https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864>\
**Category:** Need help\
**Created:** [May 10, 2024, 10:19pm UTC](https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864 "2024-05-10T22:19:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kris.davis.digital](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kris.davis.digital](https://forum.bubble.io/u/kris.davis.digital)\
**Post date:** [May 10, 2024, 10:19pm UTC](https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864/1 "2024-05-10T22:19:27Z")

</div>

I am trying to figure out how to trim just the last 2 characters from a string before I save it. Any help is greatly appriciated!

 ![Screenshot 2024-05-10 at 4.19.04 PM](https://us1.discourse-cdn.com/bubble/original/3X/0/4/04828f0b4767124188a6455fec063a2e7b429ddb.png)

---

<div class="post-metadata">

**Author:** ![GH5T](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gh5t/32/209141_2.png) [@GH5T](https://forum.bubble.io/u/GH5T)\
**Post date:** [May 10, 2024, 10:22pm UTC](https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864/2 "2024-05-10T22:22:01Z")

</div>

Your results `truncated by 7`.

Or use a RegEx expression to remove that.

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/2/d245bf2927b99e85af82ad092c2a2eb3c53c33d8.png)

---

<div class="post-metadata">

**Author:** ![kris.davis.digital](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kris.davis.digital](https://forum.bubble.io/u/kris.davis.digital)\
**Post date:** [May 10, 2024, 10:54pm UTC](https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864/3 "2024-05-10T22:54:53Z")

</div>

Ideally I would like to get a character count and remove two from the back because I don’t know how long the string will be but I do know I will always want to axe the last two characters.

---

<div class="post-metadata">

**Author:** ![GH5T](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gh5t/32/209141_2.png) [@GH5T](https://forum.bubble.io/u/GH5T)\
**Post date:** [May 10, 2024, 10:56pm UTC](https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864/4 "2024-05-10T22:56:00Z")

</div>

Your solution is above.

---

<div class="post-metadata">

**Author:** ![kris.davis.digital](https://avatars.discourse-cdn.com/v4/letter/k/b19c9b/32.png) [@kris.davis.digital](https://forum.bubble.io/u/kris.davis.digital)\
**Post date:** [May 10, 2024, 11:04pm UTC](https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864/5 "2024-05-10T23:04:35Z")

</div>

RegEx FTW, thank you!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [July 19, 2024, 10:20pm UTC](https://forum.bubble.io/t/removing-last-2-characters-from-a-string-uploading-screenshot-2024-05-10-at-4-18-36-pm-png/321864/6 "2024-07-19T22:20:12Z")

</div>

This topic was automatically closed after 70 days. New replies are no longer allowed.
