Last active
August 23, 2018 16:08
-
-
Save SalesforceBobLightning/1d2be1a48e89c6a0d22787943789a826 to your computer and use it in GitHub Desktop.
String Utilities for Salesforce Apex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class StringUtils { | |
| public static String format(String format, String param1){ | |
| return String.format(format, new String[] {param1}); | |
| } | |
| public static String format(String format, Object param1){ | |
| return String.format(format, new String[] {String.valueOf(param1)}); | |
| } | |
| public static String format(String format, Decimal param1){ | |
| return String.format(format, new String[] {String.valueOf(param1)}); | |
| } | |
| public static String format(String format, Integer param1){ | |
| return String.format(format, new String[] {String.valueOf(param1)}); | |
| } | |
| public static String format(String format, String param1, String param2){ | |
| return String.format(format, new String[] {param1, param2}); | |
| } | |
| public static String format(String format, String param1, String param2, String param3){ | |
| return String.format(format, new String[] {param1, param2, param3}); | |
| } | |
| public static String format(String format, String param1, String param2, String param3, String param4){ | |
| return String.format(format, new String[] {param1, param2, param3, param4}); | |
| } | |
| public static String format(String format, String param1, String param2, String param3, String param4, String param5){ | |
| return String.format(format, new String[] {param1, param2, param3, param4, param5}); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment