Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Take out what is inside brackets...

Status
Not open for further replies.

snowboardr

Programmer
Feb 22, 2002
1,401
PH

What would be the best way to remove the text inside the brackets and the brackets as well..?

I have a bunch of data stored like this:

MyData = "[This is text1...]text1|text2|text3|"

then I split it up like so..

MyDateSplit = Split(MyData, "|")



 
Code:
Do while instr(myData,"[")>0
   mydata=replace(mydata,mid(mydata,instr(myData,"["),instr(myData,"]")-instr(myData,"[")+1))
next ' is it next for this loop? I can never remember!
mydata=replace(mydata,"[","")
mydata=replace(mydata,"]","")

assuming that it is you who is controlling the text insertion in brackets

Derren
[Mediocre talent - spread really thin]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top