On Apr 20, 11:51 am, kevinliu23 <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> So I have a question regarding the split() function in the string
> module. Let's say I have an string...
>
> input = "2b 3 4bx 5b 2c 4a 5a 6"
> projectOptions = (input.replace(" ", "")).split('2')
> print projectOptions
>
>
On Apr 21, 3:30 pm, Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> kevinliu23 a écrit :> Hey guys,
>
> > So I have a question regarding the split() function in the string
> > module. Let's say I have an string...
>
> > input = "2b 3 4bx 5b 2c 4a 5a 6"
> > projectOptions = (input.replace(" ", ""))
kevinliu23 a écrit :
> Hey guys,
>
> So I have a question regarding the split() function in the string
> module. Let's say I have an string...
>
> input = "2b 3 4bx 5b 2c 4a 5a 6"
> projectOptions = (input.replace(" ", "")).split('2')
The parens around the call to input.replace are useless:
pr
On Fri, 20 Apr 2007 12:15:33 -0700, kyosohma wrote:
> One hack to make it work is to add the following line right before you
> print "projectOptions":
>
> projectOptions.pop(0) # pop the first element out of the list
Which will introduce a nice bug into the Original Poster's code when the
input
Tommy Grav wrote:
> On Apr 20, 2007, at 3:15 PM, [EMAIL PROTECTED] wrote:
>> On Apr 20, 1:51 pm, kevinliu23 <[EMAIL PROTECTED]> wrote:
>>> ['', 'b34bx5b', 'c4a5a6']
>>>
>>> My question is, why is the first element of projectOptions an empty
>>> string? What can I do so that the first element is not
On Apr 20, 2007, at 3:15 PM, [EMAIL PROTECTED] wrote:
> On Apr 20, 1:51 pm, kevinliu23 <[EMAIL PROTECTED]> wrote:
>> ['', 'b34bx5b', 'c4a5a6']
>>
>> My question is, why is the first element of projectOptions an empty
>> string? What can I do so that the first element is not an empty
>> string? but
kevinliu23 wrote:
> Hey guys,
>
> So I have a question regarding the split() function in the string
> module. Let's say I have an string...
>
> input = "2b 3 4bx 5b 2c 4a 5a 6"
> projectOptions = (input.replace(" ", "")).split('2')
> print projectOptions
>
> ['', 'b34bx5b', 'c4a5a6']
>
> My que
On Apr 20, 1:51 pm, kevinliu23 <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> So I have a question regarding the split() function in the string
> module. Let's say I have an string...
>
> input = "2b 3 4bx 5b 2c 4a 5a 6"
> projectOptions = (input.replace(" ", "")).split('2')
> print projectOptions
>
>
kevinliu23 wrote:
> Hey guys,
>
> So I have a question regarding the split() function in the string
> module. Let's say I have an string...
>
First of all, the string module is pretty much deprecated nowadays. What
you are actually using, the .split() method of a string, is the
preferred way to
On 2007-04-20, kevinliu23 <[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> So I have a question regarding the split() function in the string
> module. Let's say I have an string...
>
> input = "2b 3 4bx 5b 2c 4a 5a 6"
> projectOptions = (input.replace(" ", "")).split('2')
> print projectOptions
>
> ['',
Hey guys,
So I have a question regarding the split() function in the string
module. Let's say I have an string...
input = "2b 3 4bx 5b 2c 4a 5a 6"
projectOptions = (input.replace(" ", "")).split('2')
print projectOptions
['', 'b34bx5b', 'c4a5a6']
My question is, why is the first element of proj
11 matches
Mail list logo