Re: Howto parse a string using a char in python

Discussion in 'Python' started by David Robinow, Feb 15, 2013.

  1. On Fri, Feb 15, 2013 at 6:04 PM, Steve Goodwin <> wrote:
    > Hi,
    >
    > I am looking for the python2.7 function(s) to parse a string from a colon
    > character ":"
    >
    > Sounds simple enough.
    >
    > For example, a string like "123456:789". I just need the "123456"
    > substring.(left of the :)

    "123456:789".split(":")[0]
    David Robinow, Feb 15, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    19
    Views:
    1,106
    Daniel Vallstrom
    Mar 15, 2005
  2. lovecreatesbeauty
    Replies:
    1
    Views:
    1,015
    Ian Collins
    May 9, 2006
  3. John Gordon
    Replies:
    0
    Views:
    91
    John Gordon
    Feb 15, 2013
  4. Tim Chase
    Replies:
    0
    Views:
    106
    Tim Chase
    Feb 15, 2013
  5. Mark Lawrence
    Replies:
    0
    Views:
    111
    Mark Lawrence
    Feb 15, 2013
Loading...

Share This Page