aspose file tools
The moose likes Java in General and the fly likes conversion from String to any data type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "conversion from String to any data type " Watch "conversion from String to any data type " New topic
Author

conversion from String to any data type

Amit Khatnani
Greenhorn

Joined: Dec 09, 2000
Posts: 7
how can i convert an string to an int or float or double .
Ashutosh Uprety
Ranch Hand

Joined: Nov 30, 2000
Posts: 39
for int use Integer.parseInt(string)
for long use Long.parseLong(string)
for float,double I couldn't find similar fns. but what the heck ... try it out on similar lines :-)
sunil chandwani
Greenhorn

Joined: Dec 20, 2000
Posts: 19
you can do it by parse(conversion) methods
what it does basically that it converts your String type data to internal binary format and returns as per the requirement
Pratik Khetia
Ranch Hand

Joined: Jun 29, 2001
Posts: 50
How can I convert double to an Integer ?
How can I convert float to an Integer ?
Roy Tock
Ranch Hand

Joined: Jul 16, 2001
Posts: 83
Pratik, to convert double to int or float to int, just cast like so:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: conversion from String to any data type
 
Similar Threads
How to convert byte array into string array?
date format with MS Access database
Tech Word Game
WA #1.....word association
ResultSet to Array