# Ignition Perspective need to find character in text

**URL:** <https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228>\
**Category:** Ignition\
**Created:** [August 7, 2019, 1:18pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228 "2019-08-07T13:18:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David.Bell](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@David.Bell](https://forum.inductiveautomation.com/u/David.Bell)\
**Post date:** [August 7, 2019, 1:18pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228/1 "2019-08-07T13:18:35Z")

</div>

Hello, I searched Ignition and internet and cannot see usable find string inside of text field. I need to do a CHARINDEX() (from SQL) or a FIND() (from EXCEL) to find a “-” in a text field.

Thanks

---

<div class="post-metadata">

**Author:** ![jpark](https://avatars.discourse-cdn.com/v4/letter/j/a88e57/32.png) [@jpark](https://forum.inductiveautomation.com/u/jpark)\
**Post date:** [August 7, 2019, 1:36pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228/2 "2019-08-07T13:36:52Z")

</div>

Use the expression function.

`indexOf({this.props.text},"-")`

Or with scripting:

`text.find("-")`

---

<div class="post-metadata">

**Author:** ![David.Bell](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@David.Bell](https://forum.inductiveautomation.com/u/David.Bell)\
**Post date:** [August 7, 2019, 2:03pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228/3 "2019-08-07T14:03:25Z")

</div>

Thanks, I tried several variations of it and I could not get it to find it. Did I apply this correctly?

 ![Ignition_persp_indexof_00](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/fad5f28b3ce4ece1cc9a7aec4c728930ddd621c3.jpeg)

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 7, 2019, 2:10pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228/4 "2019-08-07T14:10:36Z")

</div>

If you’re in a script you need to use Python instead of Ignition’s Expression language.

```auto
if text[0] == '-':
    some logic here

```

---

<div class="post-metadata">

**Author:** ![David.Bell](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@David.Bell](https://forum.inductiveautomation.com/u/David.Bell)\
**Post date:** [August 7, 2019, 2:29pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228/5 "2019-08-07T14:29:01Z")

</div>

Great. Will try it.

---

<div class="post-metadata">

**Author:** ![David.Bell](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@David.Bell](https://forum.inductiveautomation.com/u/David.Bell)\
**Post date:** [August 7, 2019, 3:11pm UTC](https://forum.inductiveautomation.com/t/ignition-perspective-need-to-find-character-in-text/27228/6 "2019-08-07T15:11:50Z")

</div>

> [@cmallonee](#):
>
> if text[0] == '-':

Thanks! It worked.
