Get String Index Python Method Chaining In Java