Author Topic: stripos  (Read 841 times)

How exactly does this work?

strpos(stringhay,stringneedle[,intoffset])
   -Used to locate the first occurrence of “stringneedle” in “stringhay”
   -Returns a numeric value

Code: [Select]
if (%hasNextArg && strpos(%nextArg, "-") == -1)
{
$showShapeList = $showShapeList @ " " @ %nextArg;
$argUsed[%i+1]++;
%i++;
}

i cant remember but,
stripos is case sensitive i think
strpos is not.

Code: [Select]
if(stripos(hello, hellobla) != -1)
{
    stuff();
}

Would this do stuff();?

I am still mostly confused about this...

Code: [Select]
if(stripos(hello, hellobla) != -1)
{
    stuff();
}

Would this do stuff();?

I am still mostly confused about this...
Code: [Select]
%strpos = strpos(%hello/*our hello string*/,hello/*what we're looking for in the string*/);
//strpos returns were the hello is in %hello string.
//its returns where it is relative to how many letters it is away from the start of the string

What will it return if it has no similarity? -1?

What will it return if it has no similarity? -1?

This is not for comparisons. This locates the position (and returns 0 up to whatever) of a string within another string and returns -1 if it is not found.

This is not for comparisons. This locates the position (and returns 0 up to whatever) of a string within another string and returns -1 if it is not found.
Thanks. That is what I wanted to know.

Is stripos case sensitive?

Stripos is case insensitive.