# String.Contains or String to Array possible?

**URL:** <https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218>\
**Category:** Editor Scripting\
**Tags:** arrays, string, compare, unreal-engine, Blueprint, question\
**Created:** [July 14, 2014, 7:48pm UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218 "2014-07-14T19:48:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![edover\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@edover\_1](https://forums.unrealengine.com/u/edover_1)\
**Post date:** [July 14, 2014, 7:48pm UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218/1 "2014-07-14T19:48:09Z")

</div>

I’ve looked high and low and I don’t see anything that would suit my needs. I have two strings, A and B, and I want to check to see if string B is contained inside string A. For example A is _Litterbox_ and B is _Box_. So in this instance B **is** contained inside of A and would return True.

I was going to write my own function to do the comparisons by splitting the A string out into an array of characters and looping from there low-level style, but I don’t think it’s possible, since using “Parse Into Array” doesn’t seem to allow a blank/empty separator.

Anyone have any suggestions?

As always, given the wonderful limitations of Blueprints, I may have to scratch this idea all together and just find a different workaround/method for what I’m trying to achieve in general.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3221808d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3221808d](https://forums.unrealengine.com/u/anonymous_user_3221808d)\
**Post date:** [July 15, 2014, 1:44am UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218/2 "2014-07-15T01:44:51Z")

</div>

Did you try doing “Get Substring”? You could set “Length” to the string length you are looking for, then increment an int for “Start Index” till it returns the string.

---

<div class="post-metadata">

**Author:** ![edover\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@edover\_1](https://forums.unrealengine.com/u/edover_1)\
**Post date:** [July 15, 2014, 3:16am UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218/3 "2014-07-15T03:16:53Z")

</div>

Yeah, great idea. Unfortunately in my daily work I’m usually dealing with one extreme or the other (as far as programming languages go) so it didn’t even occur to me to find a middle-ground. You rock.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3221808d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3221808d](https://forums.unrealengine.com/u/anonymous_user_3221808d)\
**Post date:** [July 15, 2014, 5:59am UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218/4 "2014-07-15T05:59:47Z")

</div>

Heh, glad i could help

---

<div class="post-metadata">

**Author:** ![RyanB](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanB](https://forums.unrealengine.com/u/RyanB)\
**Post date:** [July 15, 2014, 3:52pm UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218/5 "2014-07-15T15:52:58Z")

</div>

There is actually a find substring node too. If the string is not found it should return -1 which is the default start search index, otherwise I think it returns the found index of the first letter in your string.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3221808d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3221808d](https://forums.unrealengine.com/u/anonymous_user_3221808d)\
**Post date:** [July 15, 2014, 7:02pm UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218/6 "2014-07-15T19:02:08Z")

</div>

Ahh, Find substring is only in the 4.3 preview so i missed that, thanks!

---

<div class="post-metadata">

**Author:** ![edover\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@edover\_1](https://forums.unrealengine.com/u/edover_1)\
**Post date:** [July 15, 2014, 7:21pm UTC](https://forums.unrealengine.com/t/string-contains-or-string-to-array-possible/288218/7 "2014-07-15T19:21:14Z")

</div>

Good to know!
