How to convert Long to String and String to Long

One Star

How to convert Long to String and String to Long

HI,
Could any one post the solution for converting Long to String and String to Long.
Thanks,
-Teja

Re: How to convert Long to String and String to Long

Long to String:
<var>.toString()
//to protect agianst null pointers:
<var> == null ? null : var.toString()

String to Long:
Long.parseLong(<var>)
One Star

Re: How to convert Long to String and String to Long

If you have to do a lot of this type of conversion, you may want to consider tConvertType.
This is a link to a video that converts Strings to Longs w/o having to add Java in expressions.
http://bekwam.blogspot.com/2011/02/tutorial-converting-data-types-with.html
-Carl