Win a copy of Functional Reactive Programming this week in the Other Languages 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic