# Alternative to the Replace function

**URL:** <https://community.dremio.com/t/alternative-to-the-replace-function/1812>\
**Category:** Uncategorized\
**Created:** [September 11, 2018, 4:20pm UTC](https://community.dremio.com/t/alternative-to-the-replace-function/1812 "2018-09-11T16:20:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeff23](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Jeff23](https://community.dremio.com/u/Jeff23)\
**Post date:** [September 11, 2018, 4:20pm UTC](https://community.dremio.com/t/alternative-to-the-replace-function/1812/1 "2018-09-11T16:20:43Z")

</div>

Is there another similar function to “REPLACE([string] basetext, [string] text1, [string] text2)” that can be used instead?

Thanks.

---

<div class="post-metadata">

**Author:** ![anthony](https://sea2.discourse-cdn.com/flex020/user_avatar/community.dremio.com/anthony/32/670_2.png) [@anthony](https://community.dremio.com/u/anthony)\
**Post date:** [September 12, 2018, 2:58pm UTC](https://community.dremio.com/t/alternative-to-the-replace-function/1812/2 "2018-09-12T14:58:24Z")

</div>

What are you trying to achieve? Here is a list of similar functions - [https://docs.dremio.com/sql-reference/sql-functions/string.html](https://docs.dremio.com/sql-reference/sql-functions/string.html)

---

<div class="post-metadata">

**Author:** ![Jeff23](https://avatars.discourse-cdn.com/v4/letter/j/f14d63/32.png) [@Jeff23](https://community.dremio.com/u/Jeff23)\
**Post date:** [September 14, 2018, 1:03am UTC](https://community.dremio.com/t/alternative-to-the-replace-function/1812/3 "2018-09-14T01:03:46Z")

</div>

This request is related to this issue:

> [@Replace function does not include the last characters](https://community.dremio.com/t/replace-function-does-not-include-the-last-characters/1805):
>
> I am executing this query: SELECT REPLACE(‘A SPIDER WITH AN ANT’, ‘AN’, ‘THIN’) FROM data.“mine”.doc LIMIT 1 This is the current output of the query: A SPIDER WITH THIN T This is the expected output: A SPIDER WITH THIN THINT As you can see the current output doesn’t include the last characters. I am not sure what is the problem. Thanks and regards.

I was able to handle it using CAST.

Thank you very much for the help.
