|
-
Oct 11th, 2001, 11:16 AM
#1
Thread Starter
Hyperactive Member
instr function in javascript??
Is there any function i javascript that is equal to instr in vb. Is that the subString function?? This can not be used on a variant variable?? how do i declare and convert the variant to a string??
is it String() variablename = toString(variant variable) or ???
/Smirre
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Oct 11th, 2001, 11:17 AM
#2
PowerPoster
there is only one datadype in JS. so why would you have to convert it to a string?
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Oct 11th, 2001, 02:52 PM
#3
Thread Starter
Hyperactive Member
.....
To be able to use the substring method of the string object?!?!?!?!
Or is there any other way???
Because when I try use the substring method on a variant variable it doesn't work because the object does not support the specified method.....
/Smirre
Visual Basic
C, C++
Java
Access
SQL Server
MCP, MCSD
-
Oct 11th, 2001, 03:15 PM
#4
Member
It's the indexOf method of a string object (test.indexOf("something") returns the index of "something" in test).
-
Oct 12th, 2001, 05:08 PM
#5
Fanatic Member
To create a String object you can use this syntax:
var myNewString = new String(myOldVariant);
-
Oct 12th, 2001, 07:23 PM
#6
PowerPoster
Re: .....
Originally posted by Smirre
To be able to use the substring method of the string object?!?!?!?!
Or is there any other way???
Because when I try use the substring method on a variant variable it doesn't work because the object does not support the specified method.....
/Smirre
yeah, everything is just var...which covers string, int, long, char, double, float etc..
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|