-
Recent Posts
Archives
Categories
Tags
- Adapter Pattern
- Administration
- Apex
- Apex Method of the Day
- Approvals
- Batch Apex
- Careers
- Chrome
- Controller
- Customer Portal
- Dreamforce
- Dynamic Binding
- Field Set
- FinancialForce
- FinancialForce.com
- Force.com Site
- Heroku
- Hierarchical Custom Setting
- Identity Provider
- Interface
- ISV
- JSON
- Locking
- Managed Package
- message-driven-architecture
- OAuth
- Orizuru
- Plugin
- Productivity
- Security
- SObject
- SObject Secret Life
- Triggers
- Visualforce
Top Posts & Pages
RSS
Monthly Archives: August 2013
Apex Method of the Day – String myString.split(String regExp)
We can split a String into parts using a token, which in this case is a space: However, the following example, using “.” as a token will fail: System.AssertException: Assertion Failed: Expected: 3, Actual: 0 This is because the token … Continue reading
Apex Method of the Day – String myString.repeat(numTimes)
public class TestUtility { static Integer s_num = 1; public static String getFakeId(Schema.SObjectType sot) { String result = String.valueOf(s_num++); return sot.getDescribe().getKeyPrefix() + ‘0’.repeat(12-result.length()) + result; } } Force.com Apex Code Developer’s Guide – String Methods