# Replace X instead of Replace All

**URL:** <https://community.thunkable.com/t/replace-x-instead-of-replace-all/3089964>\
**Category:** Issues / Bugs\
**Created:** [July 8, 2024, 5:57am UTC](https://community.thunkable.com/t/replace-x-instead-of-replace-all/3089964 "2024-07-08T05:57:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [July 8, 2024, 5:57am UTC](https://community.thunkable.com/t/replace-x-instead-of-replace-all/3089964/1 "2024-07-08T05:57:41Z")

</div>

In a text string like “MANHATTAN” i want to replace the first occurance of letter T  
This would give “MANATAN” remaining which is my goal  
However, since the only block working to “Replace something” is the Replace All - Both of the Ts are removed which obviously give “MANHAN” - Which is not what i want

Even tried to give the letter T an index however, since the only way to remove T is still Replace All, both Ts are removed, even though an index is involved.

Simple silly thing and i am sure someone out there has a great solution -  
I could not find it here though… Any suggestions ?

PS: (“Replace all” in combo with “First occation of” does not work as “ALL” is still replaced.

I go nuts 😃

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/f/3f229931e6e2151f04c531ff37e9f832ea6815b6.png)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [July 8, 2024, 10:33am UTC](https://community.thunkable.com/t/replace-x-instead-of-replace-all/3089964/2 "2024-07-08T10:33:55Z")

</div>

Hey @stefansladdeneng1

this will work for your described use-case of “Remove first occurrence of”

 ![Screenshot 2024-07-08 at 11.32.15](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/2/5/25e5c10d60c2e76d8856d0b3d894d269c50a9ac4.png)

 ![Screenshot 2024-07-08 at 11.31.58](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/9/8/981915cc176255044d8eccc5b82b098775aa751f.png)

Here’s a sample:  
[https://x.thunkable.com/copy/d74e8b40f7df3d8bdb1e9bf8b4105f19](https://x.thunkable.com/copy/d74e8b40f7df3d8bdb1e9bf8b4105f19)

Let us know whether or not that works

---

<div class="post-metadata">

**Author:** ![stefansladdeneng1](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/stefansladdeneng1/32/170123_2.png) [@stefansladdeneng1](https://community.thunkable.com/u/stefansladdeneng1)\
**Post date:** [July 8, 2024, 3:29pm UTC](https://community.thunkable.com/t/replace-x-instead-of-replace-all/3089964/3 "2024-07-08T15:29:51Z")

</div>

Hello Domhnall  
Worked fine - Had to tweek it to my exact purpose.  
I suggest an update the docs with a few use cases to use when Replace text.  
Or even better, add a “Replace” block to complement “Replace All”  
Again Thanks…

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/3/e/3e6f71f1fa5e0d32119622031f244f79d8456c6a.png)

---

<div class="post-metadata">

**Author:** ![domhnallohanlon](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/domhnallohanlon/32/29554_2.png) [@domhnallohanlon](https://community.thunkable.com/u/domhnallohanlon)\
**Post date:** [July 8, 2024, 3:57pm UTC](https://community.thunkable.com/t/replace-x-instead-of-replace-all/3089964/4 "2024-07-08T15:57:41Z")

</div>

Glad it’s working for you anyway Stefan!

* * *

> [@stefansladdeneng1](#):
>
> Or even better, add a “Replace” block to complement “Replace All”

Or…even better…a RegEx block 😄

> [@Fun Share: Wordle Solver in Thunkable!](https://community.thunkable.com/t/fun-share-wordle-solver-in-thunkable/1757835/2):
>
> If we have access to JavaScript expressions then all you need is to pass the Green characters to the REGEX and replace the others with dots and the Yellow character with either brackets or vertical bars. Example: with oc in correct positions and s available in the word you will have the expression as (s|.)oc(s|.)(s|[^,]) Which should get you all words having oc as second and third characters and includes s anywhere in the word of 5 characters when searching through the list of possible words …
