"Vineeth Rakesh" wrote
How to return the position of a character in a string. Say I have
str1 =
"welcome to the world" if i want to return the position of the first
occurrence of "o" how to do it?
Others have answered but don't forget Python's help() facility.
help(str)
Would have proba
On 23/07/2010 16:43, Steven D'Aprano wrote:
On Fri, 23 Jul 2010 11:22:54 pm Vineeth Rakesh wrote:
Hello all,
How to return the position of a character in a string. Say I have
str1 = "welcome to the world" if i want to return the position of the
first occurrence of "o" how to do it?
str1.find(
On Fri, 23 Jul 2010 11:22:54 pm Vineeth Rakesh wrote:
> Hello all,
>
> How to return the position of a character in a string. Say I have
> str1 = "welcome to the world" if i want to return the position of the
> first occurrence of "o" how to do it?
str1.find("o") will return the index of the first
On 23/07/2010 15:22, Vineeth Rakesh wrote:
Hello all,
How to return the position of a character in a string. Say I have str1
= "welcome to the world" if i want to return the position of the first
occurrence of "o" how to do it?
Thanks
Vin
___
Tut
You can do it with any iterator Astr.index('o') I'm not sure what happens
when there are multiple instances of 'o' though, check the docs on index.
Sent from my iPhone
On Jul 23, 2010, at 8:22 AM, Vineeth Rakesh wrote:
> Hello all,
>
> How to return the position of a character in a strin