Re: make a string a list
- From: Tobiah <toby@xxxxxxxxxx>
- Date: Fri, 30 May 2008 12:21:50 -0700
or a string iterable ? How can I do that. I have lots of '\r\n'
characters in the string which I think can be easier if it were made
into a list and I can easily see if the required value (its a numeral)
is present in it or not after some position or after some characters'
position.
They already are. They are quite like lists in many ways:
....s = 'abcdefg'
for c in s: print c
a
b
c
d
e
f
g
'd's[3]
3s = "foo\r\n"
s.find("\r")
'foo's.replace("\r", "").replace("\n", "")
** Posted from http://www.teranews.com **
.
- References:
- make a string a list
- From: Nikhil
- Re: make a string a list
- From: Ben Finney
- make a string a list
- Prev by Date: python, dlls, and multiple instances
- Next by Date: accumulator generators
- Previous by thread: Re: make a string a list
- Next by thread: Re: make a string a list
- Index(es):