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>)
Highlighted
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

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.