Results 1 to 3 of 3
- 03-11-2010, 11:48 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 11
- Rep Power
- 0
- 03-11-2010, 12:27 PM #2
is this the thing u are looking for !!
Java Code:import java.util.Scanner; public class Sample { public void getConverted(String s) { String[] c = s.split(":"); int hour = Integer.parseInt(c[0]); int mint = Integer.parseInt(c[1]); //Separeated and converted into integer. System.out.println(hour); System.out.println(mint); /*do maths here to calculate the milliseconds. * * * */ } public static void main(String []args) { Sample s = new Sample(); s.getConverted("11:11");//passs any string from here. } }
- 03-11-2010, 12:29 PM #3
Similar Threads
-
How to convert a string into a BigInteger
By valery in forum New To JavaReplies: 4Last Post: 09-13-2011, 01:32 PM -
convert String to Double
By azurovyhrosik in forum CLDC and MIDPReplies: 5Last Post: 10-22-2008, 02:46 AM -
convert InetAddress to a string
By hunterbdb in forum New To JavaReplies: 4Last Post: 10-18-2008, 09:50 AM -
convert string to a double?
By javaMike in forum Advanced JavaReplies: 2Last Post: 11-27-2007, 03:10 AM -
convert string to float
By miss_dot in forum NetBeansReplies: 1Last Post: 11-14-2007, 11:26 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks