Skip to content

Instantly share code, notes, and snippets.

@capeterson

capeterson/Id.cls

Last active Aug 29, 2015
Embed
What would you like to do?
Id someId = [SELECT id FROM Contact LIMIT 1].Id;
String ruinedCase = ((String)someId).toLowerCase();
Id fixedCase = Id.valueOf(ruinedCase);
System.assertEquals(
String.valueOf(someId).subString(0,15),
String.valueOf(fixedCase).substring(0,15)
); //fails, for me: System.AssertException: Assertion Failed: Expected: 003i000002O2aZG, Actual: 003i000002o2azg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment