How do I create a String object in scripting?
I'm retrieving a list of File objects and want to manipulate the file name. However, whenever I try to do any String manipulations with myFile.Name, I get a VBScript error that it isn't a String object. So that lead me to start looking at Strings and getting absolutely nowhere.
For example, Mathcad won't let me do any of the following:
1. Set str = New String("foo") (All of these generates an "expected end of statement" error. Huh?)
Dim str = String("foo")
Dim str = new String("foo")
2. str = "foobar"
index = str.lastIndexOf("foo") (Complains "object required", which I presume means it doesn't think str is a String object.)
3. str = "foobar"
index = LastIndexOf(str, "foo") (Error is "type mismatch")
This is driving me nuts! How do I create a String object, especially from the file.Name method?

