Find and replace ch...
 
Notifications
Clear all

[Solved] Find and replace characters in a string in Apex

2 Posts
1 Users
0 Likes
1,605 Views
Posts: 205
 CWL
Admin
Issue starter
(@cwl)
Member
Joined: 11 years ago

How to find and replace characters in a string/json?

Issue Tags
1 Reply
Posts: 205
 CWL
Admin
Issue starter
(@cwl)
Member
Joined: 11 years ago

String str = 'anything in a string';

System.Debug(str.replace('a','$').replace('i', '@'));

 

Reply
Share: