How to split string by underscore in Python

1 Answer

0 votes
s = 'python_java_c++_c_swift'

s = s.split('_')

print(s)



'''
run:

['python', 'java', 'c++', 'c', 'swift']

'''

 



answered Oct 26, 2020 by avibootz

Related questions

1 answer 132 views
2 answers 134 views
134 views asked Aug 7, 2022 by avibootz
1 answer 264 views
1 answer 144 views
1 answer 138 views
...