retrieve different values from a single string with regular expressions and python -
suggest have this:
valuestringdate = "24/6/2010"
and want variable
day = 24 month = 6 year = 2010
use .split() method. in case, datelist = valuestringdate.split("/")
produce list: datelist = ["24","6","2010]
using indexes: day = datelist[0]
set day = "24"
from there can use day = int(day)
convert day string integer.
you should able figure out there.
Comments
Post a Comment