vb.net string remove last char...

ofcourse the  sDate dosen´t get the value like this but just to show..
sDate = "2005-03-04 00:00:00"        




sDate = frmMain.uxStartDateLine.EditValue.ToString
sDate.Remove(sDate.Length - 9)            '<----- This dosen´t work
       


I want my sDate to have this value...  "2005-03-04"   nothing more....  tips..


I can´t get it to work..


2005-03-04 00:00:00
kavvisAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Om PrakashCommented:
sDate = frmMain.uxStartDateLine.EditValue.ToString
sDate = sDate.Remove(sDate.Length - 9)          
0
jppintoCommented:
DateTime.sDate.ToString("yy-MM/dd")
0
Jorge PaulinoIT Pro/DeveloperCommented:
Try this way:
sDate = sDate.Remove(sDate.Length - 9)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

jppintoCommented:
sDate.ToString("d")
0
Jorge PaulinoIT Pro/DeveloperCommented:
Better this way:
        Dim initialData As String = "2005-03-04 00:00:00"
        MessageBox.Show(DateTime.Parse(initialData).ToShortDateString)

Open in new window

0
kavvisAuthor Commented:
Thanks for that quick replay!
And for everyone that help me to!

This solution was what I needed.. I´m a bit angry of my selves because I almost get it my selves.. but now I will never forgott it!

Thank you!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.