Jump to content
Sign in to follow this  
likecoding

How to return string between special characters

Recommended Posts

Hello, 

String = "select * from employees where ID = &myID&"

How to return the text between two &s.

Thanks.

 

Edited by likecoding

Share this post


Link to post
Share on other sites

It would be best to use a regular expression.  You could also get the positions of the various delimiter characters and then get the text between the first and second, then the third and fourth if there are more, etc.  

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  

×