Skip to content

Tag: replaceall

Replacing string for only one time in Java? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question Saying that there are String A = “aabbccdd” and String B = “abcd”, is…

How do I remove a word that contains a dash from a text?

so I want to remove a word that contains a dash between them like off-campus alongside other things that I want to remove. here is my code so far. so far it prints CS is a wonderful class So WONDERFUL amazing class cleaver class must-remove Answer You could use the regex w+-w+, which means 2 words w+, separat…