Java Get Substring From String Python Replace Space