The string-methods tag has no wiki summary.
3
votes
3answers
79 views
Unable to use multiline with pattern
I'm trying to match a string with Pattern/Matcher, however it is failing because I cannot set Pattern.MULTILINE like the Java documentation uses.
String testString = 'Line 1: Does not match\nCustomer ...
-2
votes
1answer
80 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 ...
1
vote
1answer
63 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 ...
2
votes
2answers
54 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, ...
11
votes
1answer
260 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
133 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 ...
1
vote
1answer
150 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 ...
4
votes
2answers
104 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 ...
0
votes
3answers
181 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 ...
8
votes
2answers
238 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.
...
4
votes
1answer
515 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>
...
1
vote
3answers
351 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 ...
1
vote
1answer
141 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 ...

