function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

replace semicolon with double quote and comma

Hello,

I am trying to replace  ; with ", "

I wrote below code ,jsonBody = jsonBody.replace(';','", "');

But in the string it alwyas appears the same

What can be the reason for the problem
Best Answer chosen by Ab
AbhishekAbhishek (Salesforce Developers) 
Sandrine you also try this,

Example:-

Use single quotes to encase the double quote!
SUBSTITUTE(Name,'"', '')

Just as you use double quotes to encase a single quote
SUBSTITUTE(Name,"'", "")

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.

All Answers

David Zhu 🔥David Zhu 🔥
I would use:
jsonBody = jsonBody.replace(';',',');
RSuzukiRSuzuki
Try 
jsonString = jsonString.replaceAll(';','","');

 
AbhishekAbhishek (Salesforce Developers) 
Sandrine you also try this,

Example:-

Use single quotes to encase the double quote!
SUBSTITUTE(Name,'"', '')

Just as you use double quotes to encase a single quote
SUBSTITUTE(Name,"'", "")

I hope you find the above information is helpful. If it does, please mark as Best Answer to help others too.

Thanks.
This was selected as the best answer