KOTA ITO

Generation

generate functionFri, 16 Dec 2022

文字列の中から、「調査対象期間:」という文字列と「〜」という文字に囲まれた日付の文字列だけを取得する

def get_date(s): a = s.find("調査対象期間:") a = a + 6 b = s.find("〜") return (s[a:b]) get_date("調査対象期間:2017年2月10日〜2017年2月16日")

Questions about programming?Chat with your personal AI assistant