Page 1 of 1

Delete String After Certain Character

Posted: Sun May 08, 2016 6:28 am
by CElwell
Is there a way to delete the string of text after a specific character?

For example my data is this:
(Words here) But I don't want the words here

I want my data to look like this:
Words here

I want to display just the words within the parenthesis. I deleted the first character, but no matter if I try using delete, replace, etc I can't get rid of the rest. Is this possible?

Thank you,
Cassidy

Re: Delete String After Certain Character

Posted: Sun May 08, 2016 7:31 am
by dunbarx
Hi.

Easy. Look up the "offset" function. You would (Pseudo)

Code: Select all

put your Text into a variable
get the offset of the char you want to delimit that text
delete all the chars after the offset value
 
Another way (pseudo)

Code: Select all

set the item delimiter to the char of interest
delete item 2 of your text
Craig Newman

Re: Delete String After Certain Character

Posted: Sun May 08, 2016 6:59 pm
by CElwell
Thank you so much I got it to work with offset :)

Code: Select all

delete char 1 of test
put offset(")", test) into tOffset
delete char tOffset in test
delete char (tOffset + 1) to -1 of test