Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching a String

Status
Not open for further replies.

timmbo

Programmer
Feb 22, 2001
167
US
Hi All,

I have a string containing date/time. What I need to do is seperate the two into two different variables(strings). The date/time string to be seperated would look something like -

6/1/2004 08:00 AM or 10/22/2004 11:59 PM, etc...

What would be the easiest way to break this up. Does anyone have any samples I can view.

Any help most appreciated.

TIA,
Tim
 
You could use indexOf() to find the first occurence of a space character, then use substring() to get the chars up to that index for the date and after that index for the time.

[blue]"Well, once again my friend, we find that science is a two headed beast. One head is nice, it gives us aspirin and other modern conveniences,...but the other head of science is BAD! Oh, beware the other head of science, Arthur; it bites!!" - The Tick[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top