how do you convert a string to long?

String str = "123456789"; to long lng = 123456789;

thanks.