Answers for "check if string has square brackets python"

0

check if string has square brackets python

string = "This is a [sentence]"


first = string.find("[")


second = string.find("]")


print(string[first + 1:second])
Posted by: Guest on February-09-2022

Code answers related to "check if string has square brackets python"

Python Answers by Framework

Browse Popular Code Answers by Language