Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

String  RSS feed

 
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
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!