AzKay Posted May 28, 2007 Posted May 28, 2007 Func __StringBetween($s, $from, $to) $x = StringInStr($s, $from) + StringLen($from) $y = StringInStr(StringMid($s, $x +1), $to) Return StringMid($s, $x, $y) EndFunc I tryed converting that to javascript, but I fail at javascript, Thus it failed. Anyone have any ideas? # MY LOVE FOR YOU... IS LIKE A TRUCK- #
therks Posted May 29, 2007 Posted May 29, 2007 function _stringBetween(sSource, sFrom, sTo) { sOutput = sSource iFrom = sOutput.indexOf(sFrom) if (iFrom == -1) return false sOutput = sOutput.substring(iFrom + sFrom.length, sOutput.length) iTo = sOutput.indexOf(sTo) if (iTo == -1) return false sOutput = sOutput.substring(0, iTo) return sOutput } sTest = 'Hello my name is Simon, I like to do drawings.' alert(_stringBetween(sTest, 'my', 'to')) My AutoIt Stuff | My Github
AzKay Posted May 30, 2007 Author Posted May 30, 2007 Thanks :3 # MY LOVE FOR YOU... IS LIKE A TRUCK- #
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now