Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.linkpendium.com!news.linkpendium.com!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Howto parse a string using a char in python Date: Fri, 15 Feb 2013 23:11:52 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 20 Message-ID: References: <511ebf0c$0$21334$9a6e19ea@unlimited.newshosting.com> NNTP-Posting-Host: panix1.panix.com X-Trace: reader1.panix.com 1360969912 15840 166.84.1.1 (15 Feb 2013 23:11:52 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 15 Feb 2013 23:11:52 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:38971 In <511ebf0c$0$21334$9a6e19ea@unlimited.newshosting.com> "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 gordon@panix.com B is for Basil, assaulted by bears -- Edward Gorey, "The Gashlycrumb Tinies"