|
-
Dec 8th, 2004, 04:19 PM
#1
Thread Starter
Lively Member
Removing ":" and space sign
Hi,
I have this code
VB Code:
Dim timenow as String = System.DateTime.now
this return somethign like this
How do i remove those "-", ":" and the space between 2004 and 22?
thanks
-
Dec 8th, 2004, 04:32 PM
#2
Fanatic Member
Re: Removing ":" and space sign
You can get the date, year, month, time etc. all by themselves. Try this:
System.DateTime.Now.Year, System.DateTime.Now.Month, System.DateTime.Now.Day etc.
Author for Visual Basic Web Magazine
-
Dec 8th, 2004, 04:37 PM
#3
Re: Removing ":" and space sign
you can chain the replace function together (great little feature of the .net objects)
Code:
Dim str As String = Now.ToString
str = str.Replace(":", "").Replace(" ", "").Replace("-", "")
MsgBox(str)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|