This should be a simple problem for anyone who has experience working with strings in Visual Basic 6. It's actually kind of a fun little challenge. Here's what I need:
Given four different strings that look like this:
You do not need to be an actor.
You don't need to be an actor.
You don't have to be an actor.
You do not have to be an actor.
The program should output something that looks like this:
You {do not need|don't need|don't have|do not have} to be an actor.
So it basically looks at all the different strings, tries to figure out which words have been changed and where and then creates the curly brackets and vertical pipe format. The { signals that word-replacements are coming up... the | is used to separate the word replacement and the } signals that the word-replacements have ended.
The example I have provided above is only one sentence with 4 sentence variations.. In reality the input will be multiple sentences so the program should be able to work with multiple sentences. Also, 4 sentences will not always be provided. The program should be able to work with as many inputs as required... be it less than 4 or more than 4. Please test the following scenarios to make sure you have the solution correct:
Input:
This is a simple replacement.
This is a basic replacement.
Output:
This is a {simple|basic} replacement.
----------
Input:
This is a pretty simple replacement.
This is a fairly basic replacement.
Output:
This is a {pretty simple|fairly basic} replacement.
--------
Input:
This is one that is tricky, is it not?
This is a fairly tricky input, is this not?
This is somewhat of a tricky one, is it not?
Output:
This is {one that is tricky|a fairly tricky input|somewhat of a tricky one}, is {it|this} not?