How can i find every instance of a repeating string in a list, and then concatenate it to the list element that precedes it in every instance?

14 views Asked by At

I'm trying to nest a list of elements into group of elements that I can turn into an array.

My issue is that every string in my list that includes "Inc." at the end of it was separated from the rest of the string by a comma.

Since my list is very long, I want a function/method that will find every repeating instance of the list element " Inc." and concatenate it to the element in the list that precedes it, as each instance of " Inc." actually should've been part of the string that comes before it in the list.

I haven't tried a solution yet, I'm not actually exactly sure where to start.

0

There are 0 answers