Re: Inserting '-' character in front of all numbers in a string
- From: John Nagle <nagle@xxxxxxxxxxx>
- Date: Fri, 30 Mar 2007 21:58:46 GMT
Paul McGuire wrote:
On Mar 30, 2:09 pm, Michael Bentley <mich...@xxxxxxxxxxxxxxxxx> wrote:
On Mar 30, 2007, at 10:38 AM, kevinliu23 wrote:
I want to be able to insert a '-' character in front of all numeric
values in a string. I want to insert the '-' character to use in
conjunction with the getopt.getopt() function.
' '.join(map(lambda x: '-' + x, s.split()))
assuming that you just want to put a "-" in front of each field,
regardless of its content.
John Nagle
.
- References:
- Inserting '-' character in front of all numbers in a string
- From: kevinliu23
- Re: Inserting '-' character in front of all numbers in a string
- From: Michael Bentley
- Re: Inserting '-' character in front of all numbers in a string
- From: Paul McGuire
- Inserting '-' character in front of all numbers in a string
- Prev by Date: Mouse click in python
- Next by Date: Newbie Question (real-time communication between apps: audio, 3d, PD, Blender)
- Previous by thread: Re: Inserting '-' character in front of all numbers in a string
- Next by thread: Re: Inserting '-' character in front of all numbers in a string
- Index(es):
Relevant Pages
|