/**
* @author Mallikarjun G
*
*/
public class JavaStringReplaceExample {
/**
* @param args
*/
public static void main(String args[]) {
String str = "Replace String";
System.out.println(str.replace('R', 'A'));// Replaceing R with a in str
System.out.println(str.replaceFirst("Re", "Ra"));// Replaceing First Re with Ra in str
System.out.println(str.replaceAll("Re", "Ra")); // Replaceing All Re with Ra in str
}
}
Wednesday, November 3, 2010
Replace String Example in Java
Java, J2EE, Struts, Hibernate, Web Services, JSF
Replace String Example in Java,
Replace String in Java
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment