Answers for "replace character in string"

6

js replace characters in a string

var str = "Original string!";
var str = str.replace("Original", "New");
Posted by: Guest on September-29-2020
14

string replace java

public static void main(String args[]){  
String s1="my name is khan my name is java";  
String replaceString=s1.replace("is","was");//replaces all occurrences of "is" to "was"  
System.out.println(replaceString);  
}}
Posted by: Guest on April-08-2020
3

javascript regex replace

const search = 'duck'
const replaceWith = 'goose';

const result = 'duck duck go'.replaceAll(search, replaceWith);

result; // => 'goose goose go'
Posted by: Guest on June-23-2020
3

replace character in string java

String str = ".............................."; 

        int index = 5; 
  
        char ch = '|'; 
 
        StringBuilder string = new StringBuilder(str); 
        string.setCharAt(index, ch); 

        System.out.println(string);
Posted by: Guest on August-14-2020
0

replace char in string

string.replace('characterToReplace', '');
Posted by: Guest on August-02-2021
0

tr replace char for string

#Use sed for replacing a char witha string as in following example:
echo "a~b" | sed 's/~/==/g'
Posted by: Guest on November-26-2020

Code answers related to "replace character in string"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language