Saturday, July 20, 2013

How to update a string content with out using string in java.



This is very simple question, but some people think too much..and could not found solution..
one of my fren got this question from interview. he was failed to answer this in that interview..
We have solution now by using "replace/replaceAll"

ex :
I am staying in Hyderabad.
he wants to update "Hyd" to "Cyb". then out put should be "I am staying in Cyberabad"

System.out.println( "I am staying in hyderabad, im studing in hyderabad".replaceAll("hyd", "cyb"));