Sign in to follow this  
Followers 0
e2e4au

Returning characters in a string

3 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  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.

 

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
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
Sign in to follow this  
Followers 0