Skip to content

Instantly share code, notes, and snippets.

@lfreeland
Created April 24, 2016 15:14
Show Gist options
  • Save lfreeland/9e1cdd40ab1ad1e97f5acf3e88027d75 to your computer and use it in GitHub Desktop.
Save lfreeland/9e1cdd40ab1ad1e97f5acf3e88027d75 to your computer and use it in GitHub Desktop.
String format = 'Select Id from Account where Id = \'\'{0}\'\'';
String Id = '<some_id>';
String query = String.format(format, new List<String>{ Id });
system.debug(' query is ' + query);
// Output: query is Select Id from Account where Id = '<some_id>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment