文字列内での文字列の位置

🟢 Python
投稿日: 2026年5月12日8:27
s = value.find(arg)

pre= value[:s]
valueの中でargの開始位置を取得

preに見つかった位置より前の文字列を取得している。
No Comment