On 15 Jul 2003 19:51:56 -0700,
(Vinoo Vasudevan) wrote:
> (lamar_air) wrote in message news:<. com>...
>> I need a piece of code that takes a string like this string1 =
>> "aaa/bbb/ccc/dd" and extracts a string containting the character after
>> the last "/"
>>
>> So for this example the result would be "dd"
>>
>> like this:
>> for i=0; string1.right(i) != '/'; i++
>>
>> result = string1.mid(i, string1.length())
>>
>> but in python.
>
>How about this:
>string1 = 'aaa/bbb/ccc/dd'
>result = string1[string1.rfind('/')+1:]
>
>Hope it's helpful,
Sorry Vinoo, for some reason your post did not show up for me before I posted
the same solution, even though your post is dated much before mine.
I guess it has to do with delays in news servers forwarding and such.
Regards,
Bengt Richter