Hi,
I posted this problem around 3-4 days back.....I have tried to paraphrase
the problem in a probably simpler way below.
I want to generate permutations of a string made up of 2 or more words in
such a way that I get outputs :
a) where there is no space between any of the words in the string
b) Where there is only one space between any 2 words in the string.
c) where there is a single space between some of the letters in the string
but rest words dont have any space between them. And do this process for all
possible permutations.
I have got solutions to a) and b) by swiping from previous posts. ( Split
array method )
It's the c) which is..
For example if I have a string in Cells(1,1) having the value -- I went to
Paris --
the answer for a) will be -- IwenttoParis --
the answer for b) will be -- I went to Paris -- Basically, b) will be same
as the original string.
the answer(s) for c) would be
i) Iwentto Paris
ii) I wenttoParis
iii) Iwent toParis
iv) Iwent to Paris
v) I went toParis
vi) I wentto Paris
Explanation - of part c) :
In parts i) and ii) 3 of the words in the string have been combined together
and the lone word is separated by a single space.
In part iii) 2 sets of adjacent words have been combined together and there
is a single space between these 2 set.
In parts iv), v) and vi) ONLY one set of adjacent words have been combined
together and there is a single space between any 2 words.
How to effect the above combinations... in view of the fact that number of
words in the string (Cells(1,1)) would be variable.
Thanks a lot,
Hari
India
Bookmarks