Questions tagged [substring]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
2answers
49 views

Can you combine substring and indexOfChar in the same line?

I have an HTTPResonse that when you get the body looks like this: {"id":"/Project/34rxq38ntgrvxj7vkzqj8xe7v68"} I want to get the Id from it to use later and I'm having trouble figuring out how ...
1
vote
1answer
19 views

How do I remove repeating parts?

I'm trying to remove a substring with \n + random dateTime value + created date time.. My code works, but I want to make it prettier. How do I remove repeating parts by different conditions? If it's ...
1
vote
1answer
70 views

Extract all occurences of a substring from a string

hello guys how would i extract all instances of a substring pattern given a string. e.g given a string templateContent = 'hello adrian , this is for {!Contact.Name} to be delivered to {!Account....
0
votes
1answer
66 views

System.StringException: Ending position out of bounds:

I am getting the titled error System.StringException: Ending position out of bounds:99 for the below code: CusObj2.ProdName__c=CusObj2.Name__c.substring(0,99); All I want to do is truncate the ...
1
vote
1answer
17 views

Is it possible to remove of filter keysets by a standard method and only maintain keyset which start with a string

I query over Custom metadata to get 1 record(settings) with custom fields "MdtFieldsAcc" I pass the fields in a map with .getPopulatedFieldsAsMap() and then currently remove 1 keyset (Id). Is there a ...
1
vote
1answer
33 views

Ending position out of bounds: 10

I am trying to get the first 10 characters from "Patient_Name__c" field into the "Patient_Id_Help__c" field but when i run the batch class it is throwing the error as "Ending position out of bounds: ...
0
votes
1answer
33 views

How to fetch the values from the String to store in a seprate string upto certain part

Hi I need to store the certain part of the string and store it in a separate integer variable. My Final string getResult = {"httpStatus":200,"httpRequestUri":"/sfsImagingservices/documents/followup/...
0
votes
1answer
70 views

AMPScript SubString Adding in Additional Character

I am trying to work out a way to personalize emails whereby I utilize the "Full Name" field but parse the data after the first space. I am having issues with my AMPScript for this block: %%[ SET @...
0
votes
1answer
114 views

Removing characters from data extension field via AMPScript

A field used in a sendable data extension contains a value that I'm trying to remove the beginning characters from then add the remaining characters to the end of a different URL. Example: Data ...
0
votes
1answer
552 views

How Can I Get A Substring From A Long Text Area Field?

I have a Description field of type Long Text Area. I'm trying to get the first few lines to display. 1. I tried creating a formula field LEFT(Description, 500) I get Error: You referenced an ...
2
votes
1answer
34 views

substring assignment to limit data to custom field

I have a custom object with a custom field Message__c designed to hold 4000 characters. However, the getBody in rare circumstances has exceeded the 4000 character limit and caused an error. I have ...
2
votes
1answer
935 views

How do I check if substring is out of bounds?

I'm trying to find a way to check if a substring causes an out of bounds error in an If statement This is what I have got so far but if the original string has less than 8 characters after substring ...
0
votes
1answer
275 views

Replace substring with masking character in Visualforce

How do I replace a substring with a masking character in Visualforce? For eg. I have a list of Contacts under an Account to be displayed on the Visualforce page - email field to be masked. username@...
0
votes
1answer
557 views

Check For Special Characters in Emails

I'm having a business requirement of searching special characters in Email Field(before @domain.com)in a trigger. For Ex: if a email is like this (t#@est@gmail.com).it should be able to identify the'#...
1
vote
2answers
105 views

Error on Apex Trigger when trying to use “substringAfter(' ')”

I started this issue in another post but figured I'd separate it so that I could go into further detail here. I'm attempting to remove the city that is after the space. As an example the variable is ...
0
votes
1answer
291 views

How to update record values through email body

I have a requirement to create case for specific subject email.I wrote an email service working well. But now i try to capture some values from email body and need to updatein specific field. Like ...
0
votes
1answer
703 views

Can I use Ampscript to remove the last character from a URL?

I am attempting to remove the last character from a URL string. Can I achieve this using Ampscript? It seems like it might be possible using lenght() and substring() and subtract() but I can't seem ...
1
vote
1answer
429 views

trim namefield from right in SOQL

How can I trim a namefield from right and have only last n Characters. I only found examples from left. I have the following SOQL where I tried this: [select Name, Body, BodyLength from Attachment ...
1
vote
2answers
34 views

Using IF Substring to change link or image based on the market the email goes to

I am currently using in email to call an image or link based on needs. %%[IF Substring(ISO_CNTRY_2_CD,1,2) == "US" THEN]%% <br><br>US<br><br> %%[ELSE]%% <br><br>CA&...
0
votes
1answer
59 views

Capture everything but the last 3 digits

I need to capture the value of a number without the digits. Let's say I need only 17 from 17,873. The number can also be without comma, like 17873. How can I do that with AMPscript substring? A round ...
1
vote
3answers
2k views

Check If String Starts With Any Of A Set<String>?

This is basically what I'm trying to accomplish: I have a Set of strings, for example: Set<String> emails = new Set<String>{'abuse@','database@','fbl@','ftp@'}; I also have a list of ...
0
votes
1answer
231 views

Replace double character with single in string

I have to replace double semicolon (;;) in a string with single comma(,) in an apex class. Can someone help me?
0
votes
1answer
504 views

get specific value from string based on separator

I have a code String[] base = new String[]{'my father | name is | bryan luke','my mother | go to | shopping mall'}; for(integer i=0; i < base.size(); i++) { String output = base[i]; ...
0
votes
2answers
289 views

how to get the value of string based on my separator

I need to get this string before my separator, in this case a pipe character ('|'). So if I have this data: Malcolm Bell Landgraab | EMP-00012 | Consultant Juliawati Sandra | EMP-00003 | Consultant ...
1
vote
1answer
380 views

Substring for a specific value

I have below string value from which I need a specific section to put in another string. Can someone please help? String [{"attributes":{"type":"Call2_vod__c","url":"/services/data/v37.0/sobjects/...