Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Problem with the date 2005-07-14

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am having a problem with a date being passed as 2005-07-14 from a String Array of selected dates.

Here is my code:

private String getMaximum(String[] array)
{
int maximum = 0;

if (logger.isInfoEnabled())
{
logger.info("WizardReportForm getMaximum()");
}
if (array != null)
{


for (int index = 0; index < array.length; index++)
{

int value = Integer.parseInt(array[index]);
System.out.println(value);
System.out.println(maximum);
if (value > maximum)
{
maximum = value;

}

}

String str = Integer.toString(maximum);

return str;
}
return null;

}


How do I take that date and remove the dashes- but keep the orginal in the array list, and pass the date without the dashes on to the db.

Help Lost again!
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not really following your process, but if all you need to do is create a new String that's like the old String except that it has the dashes removed (keeping the old String intact), try this...

[ August 02, 2005: Message edited by: marc weber ]
 
Abigail Moore
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. That helped a lot!
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh.. the 14th of July, what a troublesome date!
 
    Bookmark Topic Watch Topic
  • New Topic