Re: Python String Handling

2016-11-12 Thread Jon Ribbens
On 2016-11-12, subhabangal...@gmail.com wrote: > I am restating the problem. > > "Hello my name is Richard" > > is a string. > > I have tagged the words Hello and Richard > as "Hello/Hi" and "Richard/P". > After this I could get the string as a list of words > as in, > ['Hello/Hi','my','name','

Re: Python String Handling

2016-11-12 Thread subhabangalore
On Saturday, November 12, 2016 at 7:34:31 AM UTC+5:30, Steve D'Aprano wrote: > On Sat, 12 Nov 2016 09:29 am wrote: > > > I have a string > > "Hello my name is Richard" > > > > I have a list of words as, > > ['Hello/Hi','my','name','is','Richard/P'] > > > > I want to identify the match of 'Hello'

Re: Python String Handling

2016-11-11 Thread Steve D'Aprano
On Sat, 12 Nov 2016 09:29 am, subhabangal...@gmail.com wrote: > I have a string > "Hello my name is Richard" > > I have a list of words as, > ['Hello/Hi','my','name','is','Richard/P'] > > I want to identify the match of 'Hello' and 'Richard' > in list, and replace them with 'Hello/Hi" and 'Richa

Re: Python String Handling

2016-11-11 Thread Thomas Nyberg
On 11/11/2016 05:29 PM, subhabangal...@gmail.com wrote: I have a string "Hello my name is Richard" I want to identify the match of 'Hello' and 'Richard' in list, and replace them with 'Hello/Hi" and 'Richard/P' respectively. The result should look like, "Hello/Hi my name is Richard/P". Simple

Python String Handling

2016-11-11 Thread subhabangalore
I have a string "Hello my name is Richard" I have a list of words as, ['Hello/Hi','my','name','is','Richard/P'] I want to identify the match of 'Hello' and 'Richard' in list, and replace them with 'Hello/Hi" and 'Richard/P' respectively. The result should look like, "Hello/Hi my name is Richard