6.Write a program to replace all the spaces in a given string with # symbol.please answer very fastly anyone???
Answers
Answered by
0
Answer:
JAVA
public class ReplaceSpace.
{
public static void main(String[] args) {
String string = "Once in a blue moon";
char ch = '-';
//Replace space with specific character ch.
string = string.replace(' ', ch);
System.out.println("String after replacing spaces with given character: ");
Answered by
0
specific character ch at 3rd line
at 2nd last line spaces with given characters
Attachments:
Similar questions