Write your own? >>> def rsplitx1(s): ... try: ... i = s.rindex('x') ... return s[:i], s[i+1:] ... except ValueError: ... return s ... >>> rsplitx1('64x43x12') ('64x43', '12') >>> rsplitx1('64x43x') ('64x43', '') >>> rsplitx1('64') '64'
Kent Jonas Melian wrote: > v = "64x43x12" -> '64x43', '12' > > How split it by the las 'x'? > > In 2.4 it could be used rsplit("x",1) > > but i've 2.3.5 > > Is there another way of splitting a string from the end? > _______________________________________________ > Tutor maillist - [EMAIL PROTECTED] > http://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - [EMAIL PROTECTED] http://mail.python.org/mailman/listinfo/tutor