# Replace string function

**URL:** <https://forum.inductiveautomation.com/t/replace-string-function/1958>\
**Category:** Ignition\
**Created:** [June 21, 2010, 4:28pm UTC](https://forum.inductiveautomation.com/t/replace-string-function/1958 "2010-06-21T16:28:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [June 21, 2010, 4:28pm UTC](https://forum.inductiveautomation.com/t/replace-string-function/1958/1 "2010-06-21T16:28:19Z")

</div>

An expression function that would allow me to replace all ‘\*’ with ‘%’.  
where \* is an arbitrary string and % is it’s replacement.

As a simple start, \* and % could be a single char. Although support for the full perl s/// function would be ideal

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 22, 2010, 3:10am UTC](https://forum.inductiveautomation.com/t/replace-string-function/1958/2 "2010-06-22T03:10:24Z")

</div>

Sounds good, shouldn’t be a problem. (In the meantime you could write one in Python and use the [tt]runScript[/tt] expression.)

---

<div class="post-metadata">

**Author:** ![Robert](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@Robert](https://forum.inductiveautomation.com/u/Robert)\
**Post date:** [June 22, 2010, 3:49pm UTC](https://forum.inductiveautomation.com/t/replace-string-function/1958/3 "2010-06-22T15:49:24Z")

</div>

Already done 🙂

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [June 23, 2010, 9:27pm UTC](https://forum.inductiveautomation.com/t/replace-string-function/1958/4 "2010-06-23T21:27:09Z")

</div>

This is in for 7.1.3 - not regex but simply substring-based. replace(source, target, replacement)
