I have a string of data that has line feeds in the middle. For example:
"Product Name \n Product Color \n Product Quantity \n Product Location \n Product Size \n Product Power"
The Amount of elements in the string could be infinite.
I need to replace the \n with >>>> \n but only when the line numbers are greater than 3 and not the last line. On the last line I need it to say (end)
I have tried map, and I can split and replace, but I'm having trouble iterating through the array to identify the lines that are to be modified. As well as joining them back up once all lines are modified or not.
Input is:
"Retract-A-Banner\n**Template:\nFull Color\nImprint Information:\nCL: 488 Special Ops Wing\n353 SOW Integrated Resilience Optimization Network\n"
Expected Output:
"Retract-A-Banner\n**Template:\nFull Color >>>> \nImprint Information: >>>> \nCL: 488 Special Ops Wing >>>> \n353 SOW Integrated Resilience Optimization Network(end)\n"