Jump to content

StringInStr?


Recommended Posts

  • Administrators

Hi all,

I have a question about StringInStr here is my test code

$location = StringInStr("How much wood" , "wood", 0, 1)
MsgBox(0,"",$location)

this gives me 10 is there a switch or something to make StringInStr go to the right insted of the left thanks for any help

-1 for the last parameter.
Link to comment
Share on other sites

  • Administrators

-1 for the last parameter.

Or do you mean you want the position of the "d"?

Edit: In which case:

$location = StringInStrEnd("How much wood" , "wood", 0, 1)
MsgBox(0,"",$location)

Func StringInStrEnd($string, $search, $case, $occur)
 $pos = StringInStr($string, $search, $case, $occur)
 If $pos Then $pos = $pos + StringLen($search)
 return $pos
EndFunc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...