Get String Index Python Method Example In Java