差分
このページの2つのバージョン間の差分を表示します。
次のリビジョン | 前のリビジョン | ||
python:find_index [2016/01/12 23:31] – 作成 ともやん | python:find_index [2019/08/19 06:52] (現在) – ともやん | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== 文字列検索 ====== | + | ====== 文字列検索(find, index) |
+ | |||
+ | ===== find, index ===== | ||
+ | <code python> | ||
+ | find(' | ||
+ | index(' | ||
+ | </ | ||
<code python> | <code python> | ||
a = ' | a = ' | ||
- | a.find(' | + | a.find(' |
-1 | -1 | ||
a.index(' | a.index(' | ||
- | ValueError | + | Traceback (most recent call last): |
+ | File "< | ||
+ | ValueError: substring not found | ||
a.find(' | a.find(' | ||
行 21: | 行 30: | ||
-1 | -1 | ||
a.index(' | a.index(' | ||
- | ValueError | + | Traceback (most recent call last): |
+ | File "< | ||
+ | ValueError: substring not found | ||
</ | </ | ||
+ | |||
+ | ===== 参考文献 ===== | ||
+ | [[https:// | ||
+ |