Originally posted by Kumara Swamy D:
Hi,
I used the replaceFirst() to solve the problem but replaceFirst() method behaviour is very strange when we are dealing with ".".
The scenarios i executed are as follows:
2)Giving wild behaviour.
Input :"Hello.world.app".replaceFirst(".", "@")
Output : @ello.world.app
Can you look at the
Java docs for the above methods, its clearly mention that first parameter is taken as
Regular Expression. If you are good with Regular expression, you don't face this problem OR Study
Regular Expression in Java