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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parse string to remove anything enclosed in braces

Status
Not open for further replies.

skurkal

IS-IT--Management
Apr 6, 2005
37
0
0
US
Hi All,

I am looking for a formula that will parse a string to remove anything in braces.

eg.

Old Column = Jane Adams (gauurk), John Doe (xgdhug), Will Ray (sygtre)
New Column = Jane Adams, John Doe, Will Ray

Any help will be appreciated.

Thanks!
 
Try this formula:

Code:
WhilePrintingRecords;
Local NumberVar c := Ubound(Split({Table.Your_Field}, ', '));
Local NumberVar i;
Local StringVar X;

For i := 1 to c do
X := X + Split(Split({Table.Your_Field}, ', ')[i], '(') [1] + ', ' ;

X := Replace(X, ' , ', ', ');

X := Left(X, Len(X)-2)

Cheers
Pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top