Questions tagged [replace]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
3 answers
58 views

How to update null records in JSON

I'm currently working on the below JSON. Sometimes records in matches return null, instead of record. And null will appear anywhere within the array { "status": "success", ...
Pavan tej's user avatar
  • 1,450
0 votes
1 answer
350 views

Apex replace \" in string

String jsonString = 'Error \"fatal\"'; String jsonString2 = jsonString.replaceAll('\\"', ''); System.assertEquals(jsonString, 'Error fatal', 'Assertion failed'); The jsonString ...
dev4life's user avatar
  • 428
-1 votes
1 answer
1k 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 -...
TechGuy's user avatar
  • 97
0 votes
1 answer
107 views

ReplaceAll does not function Apex

Hello everybody I am managing data from a LWC form where the user inputs some data and I pass it to validate into an apex class. This validation manages the format of a date time value: I want the ...
user avatar
0 votes
1 answer
625 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/...
Yaac0's user avatar
  • 155
0 votes
2 answers
236 views

Remove spaces and accents from a value field to put it in a From Email Adress field - dynamic sender profile

I need to remove spaces and accents (special characters) and capital letters from the 'From Email Address' field in the sender profile. Indeed, I would like to compose a dynamic From Email Address in ...
Lamia Hafid's user avatar
0 votes
1 answer
25 views

Modify string value in soql list and add back to list

I have a VFP which functions as a CSV download. In my controller I return a simple SOQL list from a custom Customer object. I need to modify the Name being returned to remove all commas and then add ...
Wes's user avatar
  • 41
0 votes
2 answers
6k 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/...
Olivia's user avatar
  • 3,451
0 votes
1 answer
385 views

Replace double quotes in dataview Bounce

I'm trying to replace double quotes in "SMTPMessage" field of Bounce dataview in Marketing Cloud. But I've entered in several ways, but the quotes do not disappear. What I did so far is this ...
Daniel Tazinaffo's user avatar
0 votes
1 answer
669 views

Replace escaped quotes

I want to replace all escaped quotes, but leave default quotes. How can i do it? string s1 = '"five1,five2", six ,seven,"eig\"ht1,eight2","nine",,eleven'; String ...
murkofeste's user avatar
0 votes
1 answer
3k views

Replacing text in lightning email template from apex

I have an Email template which looks like that : ----------------------- Name : {ContactName} Account : {AccountName} {price} : {Cost} Date: {MinDate} ------------- I'm using the email template to ...
Salvation's user avatar
  • 1,177
0 votes
1 answer
523 views

Replace Subject fields on Lightning Email Template

I'm having problems with replace() operations of text that I have in Subject of my Email Template. Subject is like: A - B - C My code is: EmailTemplate eTemplate = newEmail.searchForEmailTemplate('...
CPS's user avatar
  • 345
0 votes
0 answers
601 views

Unable to parse Json with special character inside Apex [duplicate]

I need to parse the below JSON in salesforce apex. In the message value, special character is not allowing to parse. Added image of JSON parser online. Javascript replace wont work in apex Ex: ...
Sharath Jallu's user avatar
0 votes
1 answer
307 views

I need to replace white space to either side of a word

I am pulling a string of text from a DE. One of the text strings contains the hyphenated word t-shirt, which ends up being split over two lines. I want to search the text string for a hyphen, then ...
mr_reamer's user avatar
0 votes
1 answer
595 views

Replace function - SQL - Data Extension

I have a data extension with a column titled 'Email Name'. My reporting I have it pipe (|) delimited into a .txt file. When the 'Email Name' column comes in, some values have spaces in the front for ...
chorlesbarkley7's user avatar
4 votes
1 answer
3k 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: ...
jdrees's user avatar
  • 207
1 vote
2 answers
5k views

Replace character in string in specific position (ie not first, not all)

I would like to replace one character in a string with an uppercase of the same character. Is there an elegant way to do this? Eg I have 'Donald Mcdonald' and I would like to uppercase the first 'd' ...
Irene's user avatar
  • 1,769
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 ...
626's user avatar
  • 273
1 vote
1 answer
11k views

Using replace() to remove a value from an array in LWC with a RegExp

I just want to remove a value from an Array in LWC using the method replace with RegExp. @track myList = ['a', 'b', 'c']; @track removeValue = 'b'; if (this.myList.includes(this.removeValue)) { ...
Carlos Naranjo's user avatar