Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
String
anvi kon
Ranch Hand
Posts: 148
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
I am getting the time from the calander like below
String
time = "16:10";
How would I convert to 1610?
How would I remove the : from 16:10?
Thanks
Steve Harney
Greenhorn
Posts: 19
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
If you are starting with a java.util.Calendar object i would use a date format ie.
java.text.SimpleDateFormat format = new java.text.SimpleDateFormat("hhmm"); format.format(calendar.getTime());
If you are convinced you need to use a string just use the replace method on the String object ie.
String time = "12:20"; time = time.replace(":", "");
Steve
Evil is afoot. But this tiny ad is just an ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
primitive conversion
how do i compare row by row
Generate random strings
Overriding
String Concat
More...