You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have the following code in which `componentList` is a list of strings
String text = "The super feature " + issue + " will be split into " + componentSize + " features, one for each component:\n"
text = text + componentList.toString() + "\n";
I am getting the following output:
The super feature SF-797 will be split into 10 features, one for each component:
[WF-ActiveTransfer ===> WILL BE GENERATED, WF-Central Security Library ===> WILL BE GENERATED, WF-Integration Server ===> WILL BE GENERATED, WF-OSGi ===> WILL BE GENERATED, WF-Service Development ===> WILL BE GENERATED, WF-webMethods.io Integration Connectors ===> WILL BE GENERATED, WF-webMethods.io MFT ===> WILL BE GENERATED, WF-WebReader ===> WILL BE GENERATED, YF-ARIS Connect ===> WILL BE GENERATED, YF-PPM ===> WILL BE GENERATED]
I would like to transform this output into the following with a new line generated between each pair of successive elements of the list:
I don't want to use a loop and keep looping as this would not be efficient.
The super feature SF-797 will be split into 10 features, one for each component:
WF-ActiveTransfer ===> WILL BE GENERATED
WF-Central Security Library ===> WILL BE GENERATED
WF-Integration Server ===> WILL BE GENERATED
WF-OSGi ===> WILL BE GENERATED
WF-Service Development ===> WILL BE GENERATED
WF-webMethods.io Integration Connectors ===> WILL BE GENERATED
WF-webMethods.io MFT ===> WILL BE GENERATED
WF-WebReader ===> WILL BE GENERATED
YF-ARIS Connect ===> WILL BE GENERATED,
YF-PPM ===> WILL BE GENERATED
Have you tried using:-
componentList.join('\n')
This will return all the list content as a multi-line String.
I hope this helps to answer your question. :-)
Thank you and Kind regards,
Ram
Has your question been answered?
If yes can you please accept the answer.
Thank you and Kind regards,
Ram
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.