User Tools

Site Tools


Sidebar

Programming Reference/Librarys

Question & Answer

Q&A is closed







java:lang:string:replace
click
to support this page (eg 0,42 € or so) Thanks.

replace

public String replace(CharSequence target, CharSequence replacement)

description of replace

this method is used to replace a char Sequence

example of replace in java

package replace;
 
public class ReplaceString {
 
    public static void main(String[] args) {
 
        String str = "Hello";
 
        str = str.replace("el", "xx");
        System.out.println("String after replacement :"+  str );
 
 
    }
}

output of replace example in java

  String after replacement :Hxxlo
advertising
java/lang/string/replace.txt · Last modified: 2013/04/23 14:22 by 92.78.126.218

Impressum