cannot use split on string object 
Author Message
 cannot use split on string object

Hi

I am having trouble splitting a string using the split function. The string
looks like this  "val_1,val_2,val_3". When I try to use the split function
on the string variable, keep getting error 'Object doesn't support this
porperty or Method'

var validFields = Request.form("validate_fields");

Get error on this statement.
validFieldsArr = validFields.split(",");

I know that validFields contains a comma delimited value, but seems it
doesn't recognize it as a string variable. Why not?



Sun, 10 Oct 2004 02:44:13 GMT  
 cannot use split on string object
var validFields = Request.form("validate_fields")

actually returns an IStringList object with a item([index]) method (actually an indexed property accessor)...

So...

var validFields = Request.form("validate_fields").item();
validFieldsArr = validFields.split(",");

or

var validFields = Request.form("validate_fields");
validFieldsArr = validFields.item().split(",");

--
Michael Harris
Microsoft.MVP.Scripting
Seattle WA US
--



Sun, 10 Oct 2004 03:22:17 GMT  
 cannot use split on string object
Sorry , I don't find any reference to any [object Object].form()  method ???
What it is exactly ? a way to parse the query string in an HTTP GET header ( just a little try prove me that it isn't) ?

Tx.

PS: In the way, any method to parse the HTTP GET query string ?

--
Frdric SAUNIER
Dveloppeur
ENLIVE S.A. 16 bis, rue d'Issy 92100 Boulogne-Billancourt
Tel : 01 46 94 94 46



Mon, 11 Oct 2004 18:32:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. how to split a split string

2. Q: howto split a string object

3. An intrinsic object cannot be stored within the Session object

4. I want to access an object by using a string reference

5. Split string by regular expression (ie. date)

6. Splitting Strings

7. String Split

8. Newbie wants to split up strings

9. Splitting a string into each character..

10. SPLIT A LONG STRING TO PUT IN A MULTILINE BOX

11. SPLIT A LONG STRING

12. Result of .split on a null string

 

 
Powered by phpBB® Forum Software