Answer the question
In order to leave comments, you need to log in
How to create a list from a string with certain criteria...?
How can I make from this line:
messageBefore = "[||~~6991~~||][||~~23838~~||][||~~-18993~~||][||~~4729~~||][**7**][||~~4713~~||][||~~367~~||]"
["||~~6991~~||", "||~~23838~~||", "||~~-18993~~||", "||~~4729~~||", "**7**", "||~~4713~~||", "||~~367~~||"]
Answer the question
In order to leave comments, you need to log in
messageBefore = "[||~~6991~~||][||~~23838~~||][||~~-18993~~||][||~~4729~~||][**7**][||~~4713~~||][||~~367~~||]"
x = messageBefore.lstrip('[')
y = x.rstrip(']')
result = y.split('][')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question