Answers for "how to split a string between two characters in python"

5

get text between two strings python

# You can do this with Reg Exp
import re

s = 'asdf=5;iwantthis123jasd'
result = re.search('asdf=5;(.*)123jasd', s)
print(result.group(1))
Posted by: Guest on June-09-2020
1

split a string with 2 char each in python

a_string = "abcde"

n = 2
split_strings = [a_string[index : index + n] for index in range(0, len(a_string), n)]
Posted by: Guest on September-19-2021

Code answers related to "how to split a string between two characters in python"

Python Answers by Framework

Browse Popular Code Answers by Language