Questions tagged [replace]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
29 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 ...
0
votes
1answer
30 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('...
0
votes
0answers
126 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: ...
0
votes
1answer
84 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 ...
0
votes
1answer
79 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 ...
2
votes
1answer
157 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: ...
1
vote
2answers
907 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' ...
0
votes
0answers
473 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 ...
1
vote
1answer
3k 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)) { ...