Re: Howto parse a string using a char in python

Discussion in 'Python' started by John Gordon, Feb 15, 2013.

  1. John Gordon

    John Gordon Guest

    In <511ebf0c$0$21334$> "Steve Goodwin" <> writes:

    > 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 :)


    > I have looked at regular expressions and string functions, so far no luck.
    > Custom function required?


    Use the split() string function.

    --
    John Gordon A is for Amy, who fell down the stairs
    B is for Basil, assaulted by bears
    -- Edward Gorey, "The Gashlycrumb Tinies"
     
    John Gordon, 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,188
    Daniel Vallstrom
    Mar 15, 2005
  2. lovecreatesbeauty
    Replies:
    1
    Views:
    1,152
    Ian Collins
    May 9, 2006
  3. Tim Chase
    Replies:
    0
    Views:
    115
    Tim Chase
    Feb 15, 2013
  4. David Robinow
    Replies:
    0
    Views:
    124
    David Robinow
    Feb 15, 2013
  5. Mark Lawrence
    Replies:
    0
    Views:
    128
    Mark Lawrence
    Feb 15, 2013
Loading...

Share This Page