This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "String" Watch "String" New topic
Author

String

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
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

Joined: Jun 19, 2010
Posts: 19

If you are starting with a java.util.Calendar object i would use a date format ie.



If you are convinced you need to use a string just use the replace method on the String object ie.



Steve
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: String
 
It's not a secret anymore!