Jump to content

Recommended Posts

Posted

I am having trouble finding a solution. I need to find "(" ")" within a string and return what ever is placed in between the parenthesis

Thanks in advance

Posted (edited)

something along this line

$string = "this is a test (this is only a test), and only another test"
$start = StringInStr($string,"(") + 1
$end = StringInStr($string,")")
$result = StringMid($string, $start , $end - $start)
MsgBox(0,"Result",$result)
Edited by gafrost

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Posted

something along this line

$string = "this is a test (this is only a test), and only another test"
$start = StringInStr($string,"(") + 1
$end = StringInStr($string,")")
$result = StringMid($string, $start , $end - $start)

<{POST_SNAPBACK}>

I must have looked through the String function list a dozen times and missed that

StringInStr :(:( - Many thanks.

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
  • Recently Browsing   0 members

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