3: 2017-09-04 (月) 08:19:46 njf | 現: 2017-09-05 (火) 14:40:09 njf | ||
---|---|---|---|
Line 3: | Line 3: | ||
testStr = "a,b,c,d,e,f" | testStr = "a,b,c,d,e,f" | ||
+ | |||
print testStr.split(",") | print testStr.split(",") | ||
Line 13: | Line 13: | ||
testStr = "a,b,c,d,e,f" | testStr = "a,b,c,d,e,f" | ||
+ | |||
print testStr.split(",",2) | print testStr.split(",",2) | ||
Line 26: | Line 26: | ||
testStr = "123456789" | testStr = "123456789" | ||
+ | |||
print list(testStr) | print list(testStr) | ||
Line 37: | Line 37: | ||
testStr = "123456789" | testStr = "123456789" | ||
+ | |||
for c in testStr: | for c in testStr: | ||
print c | print c | ||
Line 52: | Line 52: | ||
9 | 9 | ||
- | しかし、頻繁に大きな文字列を編集するならリストの方が高速なので、その場合に役立つことがあります。 | + | しかし、頻繁に大きな文字列を編集するならリストの方が高速なので、その場合に文字列のリストへの変換が役立つことがあります。 |