Questions tagged [replace]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
38 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
28 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
32 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
51 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
326 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
370 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
2k 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)) { ...