Genetic_Wolf
asked on
strstr function problem
in Javascript, I have something like this:
p = strchr(sString, 64);
doesn't work, I also tried
var p = strchr(sString, 64);
doesn't work either.
Does STRSTR exist in Java ?? Or is there any equivalent ??
thanks.
p = strchr(sString, 64);
doesn't work, I also tried
var p = strchr(sString, 64);
doesn't work either.
Does STRSTR exist in Java ?? Or is there any equivalent ??
thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I was talking about STRSTR but I think STRCHR do something similar.
Suppose we have:
p = strstr("Hello!", '!');
P = some pointer to '!' in the first string.
In VB we would say:
p = instr("Hello!", "!")
where p = 6 because VB doesn't return a pointer but a position.
But that's not my concern to me, I only want to check if a car is inside a sentence.
Suppose we have:
p = strstr("Hello!", '!');
P = some pointer to '!' in the first string.
In VB we would say:
p = instr("Hello!", "!")
where p = 6 because VB doesn't return a pointer but a position.
But that's not my concern to me, I only want to check if a car is inside a sentence.
ASKER
Vinny, indexof seem to provide the right alternative, but I can't read the value, why ?
I'm trying to find syntax or documentation...
I'm trying to find syntax or documentation...
ASKER
Vinny, Alright, I found it,
The use of ' is forbiden, I must use "
something like:
[RIGHT]
ndx = sometextValue.indexOf("@")
instead of
[WRONG]
ndx = sometextValue.indexOf('@')
or
ndx = sometextValue.indexOf(64)
ref.: http://www.devguru.com/Technologies/ecmascript/quickref/string_indexof.html
Thanks.
The use of ' is forbiden, I must use "
something like:
[RIGHT]
ndx = sometextValue.indexOf("@")
instead of
[WRONG]
ndx = sometextValue.indexOf('@')
or
ndx = sometextValue.indexOf(64)
ref.: http://www.devguru.com/Technologies/ecmascript/quickref/string_indexof.html
Thanks.
What exactly does strchr do