# Replacing a string from last

**URL:** <https://es.discourse.group/t/replacing-a-string-from-last/2266>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [January 6, 2025, 4:38am UTC](https://es.discourse.group/t/replacing-a-string-from-last/2266 "2025-01-06T04:38:50Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![lightmare](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/lightmare/32/843_2.png) [@lightmare](https://es.discourse.group/u/lightmare)\
**Post date:** [January 16, 2025, 8:20am UTC](https://es.discourse.group/t/replacing-a-string-from-last/2266/7 "2025-01-16T08:20:28Z")

</div>

> [@aclaymore](#):
>
> An alternative API could be adding a 3rd, `position` parameter to `replace`

A while ago there was a suggestion here to [add splice to String](https://es.discourse.group/t/add-splice-to-string-prototype/2242), which didn't get much positive feedback, but would also allow replace at position -- and IMO that could help other use cases, especially for those scared of regexes -- for example replacing a chunk of text between two found substrings.

---

_[View the full topic](https://es.discourse.group/t/replacing-a-string-from-last/2266)._
