new_str="@@2@@*##1"
new_str1="@@3@@*##5##7"
How to split the above string in python
for val in new_str.split("@@*"):
logging.debug("=======")
logging.debug(val[2:]) // will give
for st in val.split("@@*"):
//how to get the values after ## in new_str and new_str1
I don’t understand the question.
Are you trying to split a string by a delimiter? Then use
split:Are you trying to strip extraneous characters from a string? Then use
strip:Are you trying to remove all the hashes (
#) from a string? Then usereplace:Are you trying to find all the characters after
"##"? Then usersplitwith its optional argument to split only once: