Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:string': 0.09; 'subject:using': 0.09; 'cc:addr:python-list': 0.10; 'subject:python': 0.11; 'steve': 0.13; '":"': 0.16; 'enough.': 0.16; 'function(s)': 0.16; 'string': 0.17; 'wrote:': 0.17; 'feb': 0.19; 'parse': 0.22; 'cc:2**0': 0.23; '15,': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply- To:1': 0.25; 'skip:" 20': 0.26; 'message-id:@mail.gmail.com': 0.27; 'colon': 0.29; 'python2.7': 0.29; 'character': 0.29; 'fri,': 0.30; 'hi,': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'received:209.85.214': 0.39; 'skip:" 10': 0.40; 'sounds': 0.71; '2013': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=kJ8l6zhY/vQ4FO+xhlkuMOo6A0TCFvzU/ASOUptn+80=; b=zgZVL4PvS8O6yKwEGeuYINagqDSbhee5JI8rFBzwzQtDZhcXZwInwDRnHh/g6xW0iF RzPfwxX/Tvnn4UhY8Rq5n4W1AgK0M/MC9fU8iqBiATtAAeJiAXBpnaDAQhcN9D8usOyM 6iwUt10pyxbZxQvRTwu9pD/ircVa+gVfDafBF8klqypdmzF/yM+GOzxKl0zz72xpOeqs f2rFi1qibzIS7KOOfLO63YB+ZY6LcX8lFLfXHnpVteWoxkkSGjJRN9fIXgUCTEOgbTYV 98DO7rW4TY9L4kZXg3FVY89cUi26WBTswcQgfdtF2+OtVeHZ1NflnTHC5yzIwDsI4OLq nuwg== MIME-Version: 1.0 X-Received: by 10.182.98.5 with SMTP id ee5mr3023667obb.28.1360970349747; Fri, 15 Feb 2013 15:19:09 -0800 (PST) In-Reply-To: <511ebf0c$0$21334$9a6e19ea@unlimited.newshosting.com> References: <511ebf0c$0$21334$9a6e19ea@unlimited.newshosting.com> Date: Fri, 15 Feb 2013 18:19:09 -0500 Subject: Re: Howto parse a string using a char in python From: David Robinow To: Steve Goodwin Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360970352 news.xs4all.nl 6951 [2001:888:2000:d::a6]:42608 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38975 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]