This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String[] : cut a Date every "/"

 
Grégoire Berclaz
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am French and we write dates : "dd/MM/yyyy". I like to save dates in a SQL DB and the format is "yyyy/MM/dd". How can I cut a date every "/"? I like to have an array of String...
Tk you very much
Greg
 
Michael Morris
Ranch Hand
Posts: 3451
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Probably the simplest way would be to use the split() method of String. For example:

That will print out:

You would need to reverse the array, but since there are always three elements that should be no problem.
 
Grégoire Berclaz
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's ok... tks
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic