Skip to content
Advertisement

How to remove text in a list at each index

I have a list similar to:

JavaScript

I need to modify the list to remove the first numbers only and display the list so that after each comma there is a new line. The expected output would be:

JavaScript

I tried many codes but I’m lost now and don’t know how to arrive to my desired output.

Advertisement

Answer

One way would be the str.split on whitespace, then slice off the first element, and join back together.

JavaScript

Output

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement