String to Id Conversion

Well someday back, while writing a Visualforce page I came across a situation where I have to convert a string to Id. I tried to check methods for "Id" but couldn't find any thing well after lot tries I actually figured out a way to convert "string" to "Id".

It is super easy, you just need to follow the following code :

 String strId = 'a08A000000ZdZYk';  
 Id myId = strId;  

Hope this helps.

No comments:

Post a Comment