I have a variable with date string
> $str
5 november 2012 y. 18:24:13
When I’m trying to remove spaces from it I get another string in another format
> $str -replace " ",""
05.11.201218:24:13
How to explain this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your original
$strvariable is a DateTime object. When you try to replace that, it converts it to a string, and then it removes the spaces. Ex.If you wanted to have the first format(datetime format) without spaces, try:
More about DateTime string-formats, head over to MSDN