Java Get Substring From String Python Replace Part