>v = "64x43x12" -> '64x43', '12'
>
> How split it by the las 'x'?
[snip]
>>>v = "64x43x12"
>>>temp = v.split("x")[-1:]
>>>print temp
['12']
that's the best I can do for now.
HTH,
-Luke
___
Tutor maillist - Tutor@python.org
http://mail.python.org/m
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:
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 = "64
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/listinf