KOTA ITO

Generation

generate functionFri, 16 Dec 2022

['\r\n\t\t\t実査日: 2022年8月20日\u3000調査対象期間:2022年8月13日~8月19日'] という文字列の中の、'調査対象期間:'という文字列の後ろにある、'2022年8月13日'という日付だけをテキストとして取得する。

In [1]: S = '実査日: 2022年8月20日\u3000調査対象期間:2022年8月13日~8月19日' In [2]: S.find('調査対象期間:') Out[2]: 17 In [3]: S[17:].find(~') Out[3]: 14 In [4]: S[17+14:] Out[4]: '2022年8月13日'

Questions about programming?Chat with your personal AI assistant