- Home /
Question by
lancer · Aug 21, 2013 at 04:31 PM ·
javascriptstringsearch
search is not a member of string
I'm trying to do:
var data : String = www.text;
var n = data.search("[");
But I keep getting this error:
BCE0019: 'search' is not a member of 'String'.
Why can't I use the search function, it is a generic JavaScript function as shown here.
Comment
Best Answer
Answer by whydoidoit · Aug 21, 2013 at 04:35 PM
The problem is you aren't using Javascript (even though it's called that) you are using UnityScript.
var n = data.IndexOf("[");
You need to use the .NET functions for String