Java Replace String Function Python Example Class