Parsing a string

I need to be able to parse a string. I have searched the forum and there are a lot of search replace with text editors and using ASTIDs but these seem to be not exactly what I am looking for.

I have a string like “(some bit of text) + (the value I know) + (the value I need to remove) + (some text I need to keep)”

I will not know anything but “The Value I Know” portion of the string. I need to get everything up to “The Value I Need To Remove” without that text. Then I need the text that follows it.

As said, I only know the one value and the length of the string can change. The real goal is the substitute the text between what I know and the last bit I want with a variable that has already been defined. I can place the first part and the second part into different variables (I have already structured around this idea) and sum them whenever I need to use them.

Any ideas

Dee

I should also note that I do know the length of the text I am removing (4 characters), but not exactly what those four characters will be.

Thanks
Dee

Try something like this:

set test to "Hello, World! My name is deedeew. BOOM... How are you?"

set ASTID to AppleScript's text item delimiters
set AppleScript's text item delimiters to "My name is deedeew. "
set test to text items of test
set item 2 of test to text 5 thru -1 of item 2 of test
set test to "" & test
set AppleScript's text item delimiters to ASTID

test
--> "Hello, World! My name is deedeew. ... How are you?"