What's the correct syntax to search a .txt file for a keyword in JavaScript?
EDIT: I'm working with a subset of JavaScript called UnityScript in a program called Unity3D. It outputs .exe programs. Here's an example of UnityScript:
import System.IO;
function ReadFile () {
    var sr = new StreamReader(Application.dataPath + "/" + readFilePath);
    var fileContents = sr.ReadToEnd();
    sr.Close();
    var lines = fileContents.Split("~"[0]);
    for (line in lines) {
        Debug.Log (line);
    }
}
I thought that if I could get a function from JavaScript I could import it into my program. I see now that perhaps I was wrong.
Thanks - Elliot Bonneville
 
     
     
     
     
    