I have to replace double semicolon (;;) in a string with single comma(,) in an apex class. Can someone help me?

1 Answer 1


You can use the replaceAll() method from the String class.

String testString = 'Hello;; my name is SF support.';
testString = testString.replaceAll(';;', ',');


Result: Hello, my name is SF support.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .