How to extract text within parentheses from a string in Python

1 Answer

0 votes
s = 'c c++ (java) python'

result = s[s.find('(') + 1: s.find(')')]

print(result)




'''
run:

java

'''

 



answered Dec 5, 2023 by avibootz
...