10-18-2018 12:19 PM
Good afternoon. I need to convert a string array 2d into a string separating as per the image in the attachment. Can anybody help me?
String 2D
String that I need
Solved! Go to Solution.
10-18-2018 12:26 PM - edited 10-18-2018 12:27 PM
This might work. (FOR loop, index array concatenate string, array to spreadsheet string, trim whitespace)
10-18-2018 12:44 PM
Without loops
FYI CA's solution is probably faster, did not check, but it always is. 🙂
mcduff
10-18-2018 12:44 PM
Simple solution, I was trying to do something but did not think that way.
10-18-2018 12:50 PM
One more R-G way.
10-18-2018 01:23 PM
Be very careful with the other solutions presented. Some might blow up if e.g. one of the elements in the original string contains spaces, linefeeds, etc.). My solution retains all strings verbatim and is thus probably safer.
10-18-2018 01:29 PM
@mcduff wrote:
Without loops
FYI CA's solution is probably faster, did not check, but it always is. 🙂
mcduff
Without user defined loops. Under the hood those primitives are still looping.
10-18-2018 02:49 PM
Last solution had a bug, should be string length minus 3 NOT 3 minus string length
Some might blow up if e.g. one of the elements in the original string contains spaces, linefeeds, etc.).
Spaces should be okay, carriage returns okay, linefeeds okay, BUT the carriage return line feed combo (\r\n) if contained in the original string then you will have some problems.
mcduff