Answers for "how to replace some characters in a string in java with a number"

0

replace all these caracters in string java

String finalString1 = stringUnderscoresForward.replaceAll("[_/]", "-");
Posted by: Guest on March-30-2022
-1

how to replace a character with another character in a string in java

public class JavaExample{
   public static void main(String args[]){
	String str = new String("Site is BeginnersBook.com");

	System.out.print("String after replacing com with net :" );
	System.out.println(str.replaceFirst("com", "net"));

	System.out.print("String after replacing Site name:" );
	System.out.println(str.replaceFirst("Beginners(.*)", "XYZ.com"));
   }
}
Posted by: Guest on April-05-2021

Code answers related to "how to replace some characters in a string in java with a number"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language