Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to obtain the content of brackets

"""
This will try to split the argument into 2, using the square brackets, then
will split the index one, so, the variable foo just is the content of
any group of characters. like ()[]{}
"""
try:
  foo = arg.split("[")[1].split("]")[0]
except:
# The argument doesn't contain a class.
    pass
 
PREVIOUS NEXT
Tagged: #obtain #content #brackets
ADD COMMENT
Topic
Name
7+7 =