+ 4
How can i Convert this sentence "hello , world , program" to "hello!world! program " in java language
10 Respostas
+ 6
Yes, that is exactly the purpose of replaceAll() method. You just need to know what to find and what to replace it with.
+ 4
Do you mean to print an exclamation after each word?
"hello, world, program"
"hello! world! program!"
Like that, or did you mean something else?
+ 4
Fatma hgazy Before your thread becomes too messy, and you can't get proper help, pls edit your question and add this to the description:
1. A complete and meaningful explanation of what the code should do and how
2. A link to your attempt in Code Playground (pls do not copy/paste it)
3. An explanation of your difficulties
Pls don't spread this info in answers.
This way, people will know what help you need and everyone starts going in the same direction.
+ 2
language? code?
+ 2
Yes i mean that
+ 2
You can do this easily by replacing the commas with exclamation mark. You see? original string is
"hello , world , program"
By replacing all " , " (space surrounded comma) by "!" (rxclamation mark) - you can get such result
"hello! world! program"
Refer this for syntax and example
https://www.javatpoint.com/java-string-replaceall
+ 2
Are you understand me🥺?
+ 1
Fatma hgazy "hello, world, program" to "hello! world! program" is just replacing all the commas with exclamation marks right?
Or do you mean something else?
Just link your code, so we can understand what you're trying to ask
0
No something else
0
No i want to convert this string from "hello, world, program" to "hello!world! program"