Re: Howto parse a string using a char in python

Discussion in 'Python' started by Mark Lawrence, Feb 15, 2013.

  1. On 15/02/2013 23:04, 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 :)
    >
    > I have looked at regular expressions and string functions, so far no luck.
    > Custom function required?
    >
    > Thank you.
    >
    > - Spoog98
    >
    >


    More likely a visit to the opticians :) See
    http://docs.python.org/2/library/stdtypes.html#string-methods for the
    find and index methods.

    --
    Cheers.

    Mark Lawrence
    Mark Lawrence, 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,119
    Daniel Vallstrom
    Mar 15, 2005
  2. lovecreatesbeauty
    Replies:
    1
    Views:
    1,034
    Ian Collins
    May 9, 2006
  3. John Gordon
    Replies:
    0
    Views:
    94
    John Gordon
    Feb 15, 2013
  4. Tim Chase
    Replies:
    0
    Views:
    107
    Tim Chase
    Feb 15, 2013
  5. David Robinow
    Replies:
    0
    Views:
    116
    David Robinow
    Feb 15, 2013
Loading...

Share This Page