Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

String

 
anvi kon
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!