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
2
votes
1answer
3k views

Replace text in Rich text area field with trigger

We're using the "Solutions" standard object as our knowledge base, with "Solution details" standard field is a Rich Text Area field (32000 characters). The field structure looks like this: Purpose (...
3
votes
2answers
2k views

Extracting number values in a text field then summing up

I have this field that gets populated by an external service and I want to extract the number values from it then sum the numbers up. For instance, see the text below United Kingdom: 3, Ireland: 1, ...
30
votes
1answer
17k views

Bug in String.split('.')?

I can hardly believe it but split() doesn't work on the . character: String createDate = '01.2.2013'; String[] cd = createDate.split('.'); System.assertEquals(3, cd.size()); // Boom! Tried with '\....
5
votes
1answer
2k views

I need a String method in a Trigger to validate if a Rich Text Area is blank

I need assistance in evaluating whether a Rich Text Area custom field is blank using an Apex trigger. Rich Text Field name: Application_Workaround__c I have tried the following within the context ...
3
votes
1answer
2k views

Using RegEx Pattern Match to create DateTime fields in trigger

How do I write code with the correct syntax to run a pattern grouping match within a string, then replace the pattern groups found in the result so that they follow a desired pattern? I've never done ...
7
votes
2answers
605 views

Case sensitive highlighting of keywords

we have a rich text field in one of our objects that contains an html-document. I have created a search page and a user can click on a 'preview'-button which opens the html in a lightbox. I want to ...
2
votes
3answers
7k views

Comparing IDs - use String or don't use Strings

I have some logic where I need to iterate thru a bunch of Opportunities. I need to be able to determine when I hit a new Opportunity Owner ID. I try: String lastownerId = ''; for (Opportunity ...
11
votes
3answers
8k views

How do I do a case-insensitive replace all for a string?

I've got a project where I'd like to replicate some of the internal merge field functionality so users can build a link and it'd be really helpful if I could do a case-insensitive string replaceAll. ...
8
votes
1answer
14k views

How can I call a method from visualforce?

You would think this would be more obvious, but "how can I call a method from a visualforce page?" Say I have something like this: <apex:page controller="PreChatController "> <script> ...
2
votes
3answers
3k views

Encode Long Text Area field

I am working on some code that retrieves certain cases and then emails those cases as a csv. This is working to some extent. The problem I have is that one of the fields is 'Description' which is a ...
2
votes
1answer
2k views

New string methods substring Before/After, etc

I'm playing with the new string toys. I'm getting something out of a CSV (and I have very good reason to need to do that). I tried this: contents = contents.substringAfter('/n') and it's not finding ...

1
5 6 7 8
9