Monday, August 8, 2011

How do I replace words in Java?

Look at the API String methods. String.replace( CharSequence) is the parameter. You are ping a String. Try String.replaceAll( RegEx ), which does take a String argument and evaluates the ped String as a Regular Expression or single character String. BTW CharSequence can be StringBuilder, a powerful API that has methods of char and String.

No comments:

Post a Comment