On 05/16/2013 11:15 AM, Chris Angelico wrote:
On Fri, May 17, 2013 at 1:00 AM, loial wrote:
I want to split a string so that I always return everything BEFORE the LAST
underscore
HELLO_.lst # should return HELLO
HELLO_GOODBYE_.ls # should return HELLO_GOODBYE
I have
On 5/16/2013 11:00 AM, loial wrote:
I want to split a string so that I always return everything BEFORE the LAST
underscore
HELLO_.lst # should return HELLO
HELLO_GOODBYE_.ls # should return HELLO_GOODBYE
I have tried with rsplit but cannot get it to work.
Any help app
On 2013-05-16 08:00, loial wrote:
> I want to split a string so that I always return everything BEFORE
> the LAST underscore
>
> HELLO_.lst # should return HELLO
> HELLO_GOODBYE_.ls # should return HELLO_GOODBYE
>
> I have tried with rsplit but cannot get it to work.
.r
On Fri, May 17, 2013 at 1:00 AM, loial wrote:
> I want to split a string so that I always return everything BEFORE the LAST
> underscore
>
> HELLO_.lst # should return HELLO
> HELLO_GOODBYE_.ls # should return HELLO_GOODBYE
>
> I have tried with rsplit but cannot get it t
On 05/16/2013 11:00 AM, loial wrote:
I want to split a string so that I always return everything BEFORE the LAST
underscore
HELLO_.lst # should return HELLO
HELLO_GOODBYE_.ls # should return HELLO_GOODBYE
I have tried with rsplit but cannot get it to work.
Any help ap
On Thu, 16 May 2013 08:00:25 -0700, loial wrote:
> I want to split a string so that I always return everything BEFORE the
> LAST underscore
>
> HELLO_.lst # should return HELLO
> HELLO_GOODBYE_.ls # should return HELLO_GOODBYE
>
> I have tried with rsplit but cannot get
str.split takes a limit argument. Try your_string.split('_', 1)
On 16 May 2013 16:11, "loial" wrote:
> I want to split a string so that I always return everything BEFORE the
> LAST underscore
>
> HELLO_.lst # should return HELLO
> HELLO_GOODBYE_.ls # should return HELLO_G
I want to split a string so that I always return everything BEFORE the LAST
underscore
HELLO_.lst # should return HELLO
HELLO_GOODBYE_.ls # should return HELLO_GOODBYE
I have tried with rsplit but cannot get it to work.
Any help appreciated
--
http://mail.python.org/m