Questions tagged [string]

In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. In Apex it is considered as any set of characters surrounded by single quotes.

Filter by
Sorted by
Tagged with
0
votes
0answers
112 views

What is retString()?

I am reviewing some old code and came accross this line: List<String> segments = seg.retString(); seg has a value that's over 255 characters. When I run this method my output is empty ...
0
votes
0answers
43 views

breakline in string to pdf

I have an apex:component controller from where I pass a string to `</messaging:attachment <c:TrainersListComponent TrainingIdAttr="{!relatedTo.Training__c}" /> Which is rendered as PDF: &...
0
votes
0answers
474 views

Regex too complicated when splitting a string [duplicate]

I am trying to get the Standard Report As a csv file and try to split the file and need to do some conditions. But for the large amount of records am getting error as: Regex too complicated ...
0
votes
0answers
54 views

PageReference Keep Page Original Text Case (Upper and Lower)

This may be been asked before (I couldn't locate it), but given the below example. I need to create a url for a custom field, but the case changes. Is there a simple way around this to keep the ...
0
votes
1answer
50 views

How to evaluate a string variable containing a suitable string inside the if()..else()?

I have a string variable called ifcondition which contains something like '24<25 && 'India'=='India''. I need to evaluate this into an if...else loop.How to do that. String ifcondition='...
0
votes
0answers
801 views

Displaying a Lookup/Reference field type on a Visualforce page

I'm struggling to find this answer due to the ambiguity surrounding the many scenarios the keyword Reference can fit in to. I have multiple Reference types in my custom object. They are lookup ...
0
votes
1answer
251 views

Send email to task owner through trigger and merge task field in email body

I need help. As per our requirment i have to send email to task owner if their task due date is passed and task is still open. I know that through workflow it is not achieveble. I have done a trick ...
0
votes
0answers
34 views

How to convert in a normal text a bold text from an email body of the EmailTo SFDC Feature?

I am trying to process a text from an email body that can contain text styled with bold or italic style. From the standard feature, Mail To Salesforce, I find this text in the description field of the ...
0
votes
2answers
725 views

How to navigate multiple lists/maps and turn into string

I'm trying to populate a text field on Account with the Territory names of the account on insert or update (original territories, not Enterprise Territories or Territories2). I've mapped through ...
0
votes
0answers
32 views

Efficient, governor-aware string processing/validation in apex

I need to make sure that a string only contains ASCII characters and not any other character (e.g., from another alphabet). I need to run this in real-time on hundreds of text fields so performance is ...
0
votes
1answer
700 views

How to snip and pass a string value between brackets to a Map?

I've been searching through past questions and other literature to try to figure this out but it's time to just ask outright. I'm trying to write an after insert trigger that takes the string value ...
0
votes
2answers
1k views

Split a long string into substrings till it is empty

I tried this code to convert a string into sub-strings until the original string do not empty. Please guide where I'm wrong in it? Thanks. String dates = '01/13/2015,01/20/2015,01/27/2015,02/03/...
0
votes
0answers
99 views

In a report how do I add a filter of type String having comma seprated values e.g. 'Cats,Dogs'?

Salesforce considers 'Cats,Dogs' as 'Cats' or 'Dogs'. This link suggest putting the string value inside double-quotes, which I've already tried without any success.
0
votes
1answer
59 views

String parse to Date yymmdd

I wrote a question below : String parse to Date yyyymmdd But now I'm facing a new similar question : What if I want to parse a string yymmdd to a date? for example : 190503 instead of 20190503. ...
-1
votes
1answer
59 views

Need superscript of # in apex

I have one string which needs to change with Superscript string str="ABC#"; I want add replace superscript with #. please suggest Let me Explain with Example Suppose I enetered a string **My Name ...
-1
votes
1answer
28 views

How to grab a word from ALPHANEUMERIC field in apex [closed]

I have a field with names like 12GOLD, 13GOLD.2 ,16SILVER.4, 18PLATINUM.3 etc. I need to just get the alpha part of those words like GOLD/SILVER/PLATINUM.
-1
votes
1answer
105 views

How to convert fields values from String to DateTime format?

Actualy I'm inserting data into custom object through REST api I got some time fields like date begin and date end fields these two fields from api response <date-begin>2017-12-...
-1
votes
1answer
513 views

Save error: Illegal assignment from String to Integer

I need a string value transformed to a integer so that I can use it in a number field. Integer leadSize=(Integer.valueOf(email.plaintextbody.split('Base: ').size()) > 1) ? email.plaintextbody....
-1
votes
1answer
163 views

String value from a field of custom Object List

Please let me know how can I put a field values in a string from below List. oIncs = [SELECT Id , Name , No_Of_Transactions_abv__c , OwnerId , ...
-1
votes
1answer
25 views

Preserve the String as it

This string is part of a JSON that I have. I am trying to store the JSON string that was generated using JSON.serialize method. Part of the JSONString has "default_value": "\" \"" as one of the JSON ...
-1
votes
2answers
639 views

Why IF condition inside FOR loop not working?

I need to compare and remove two comma-separated String. VisualForce Page: <apex:page controller="input_text"> <apex:form> <apex:inputText value="{!Input}"/> &...
-2
votes
1answer
29k views

How to assign string to date type in apex code [closed]

In my code i am getting this error: Illegal assignment from String to Date Kindly anyone explain how to assign a string to date field in List (APEX code). Here is my code: for (Integer i=1; i<...
-2
votes
1answer
63 views

How to list of string can separate with commas and single quotes in apex salesforce [closed]

If my list of string is in format like 'United kindom,US,EUROPE,Canda'; String result = ''; for(string str: countries){ result = result + ',' + str; } string output = result.removeStart(','); ...
-2
votes
2answers
255 views

How to set string query using not equal to empty?

contact c=[select id,firstname,lastname ,email from contact where email !='']; above query how to set string query.Please anybody help on this
-2
votes
1answer
496 views

How can i check empty in apex?

I am in curious of knowing which way is the best to check any empty values in apex. For eg, in apex email service I need to check whether the subject is empty or not. Way 1: String subject = email....
-3
votes
1answer
64 views

Apex trigger, return string, calling methods and code correction needed

Please explain what is wrong as I have problems writing methods, and correct the code if you can. Error: Compile Error: Variable does not exist: a at line 11 column 16 trigger tokenGenerator on ...
-3
votes
1answer
938 views

How to split the values in field [closed]

A text field (let say field name is Test) in account has multiple values like aaa;123;456;abhu;ueie;4;45;. I want to split the values and store them in another variable like integer or string(what ...
-3
votes
1answer
644 views

Ending position out of bounds: 18

I have a Custom Edit button. When clicking the Edit it is showing the error as "Ending position out of bounds: 18" Below is the code for class.Thanks public with sharing class ...
-3
votes
1answer
32 views

deserialize data from stringify data

I have read many posts regarding this but I m not able to to deserialize the data . So please can anyone help me with it. serialized data: "fieldlist" : JSON.stringify(selfield) but I m not able ...
-3
votes
1answer
3k views

Pulling picklist options from a multi-value field

I am currently pulling select options for a multi-value picklist from a query which gathers field values from all of the child records from a certain __r relationship of an account. I would like to ...
-4
votes
1answer
620 views

How to escape html characters in long text area field

I have a requirement where i need to copy the contents of a contentnote to a longtextarea field called 'comments' using apex anonymous. The issue is i am getting the following HTML characters for ...

1
4 5 6 7
8