All Questions
Tagged with replace replaceall
6 questions
0
votes
1
answer
920
views
Apex replace \" in string
String jsonString = 'Error \"fatal\"';
String jsonString2 = jsonString.replaceAll('\\"', '');
System.assertEquals(jsonString, 'Error fatal', 'Assertion failed');
The jsonString ...
-1
votes
1
answer
2k
views
Replace String inside json inside Array Javascript
Hello guys I have a js file that has a list of json that have the next structure:
[{"label":"9312 - Item1", "value":"9312"},
{"label":"9313 -...
0
votes
1
answer
1k
views
Regex to find dd/mm/yyyy
I have a pretty simple code and in one case it works, and not in all the case, I wanted to know what I'm missing
I'm trying to match a date in this format dd/mm/yyyy
This is my code:
String d = '20/03/...
0
votes
2
answers
7k
views
Removing leading zeroes in Date String
I have checked a number of posts and regex examples but for some reason I can't get the leading 0's to be removed from the date string below. Can anyone see what I am doing wrong?
wanted result: 4/6/...
4
votes
1
answer
4k
views
Using String.replaceAll() to remove character combination
I need to remove all redundant hyphens in a given string, e.g.: "Bla----Bla---Bla--Bla" to "Bla-Bla-Bla-Bla", using as little code as possible.
At the moment I've implemented this:
...
0
votes
0
answers
1k
views
Error escaping double quotes in large JSON string in Apex
I have large JSON response that I am trying to escape all instances of strings that are problematic for deserialization but am having some issues.
Using .replaceAll works but that throws a "Regex too ...