Hi, I'm having a problem. I need to combine three string values by adding dashes. But I can't due to this error: Code: The '-' operator cannot be applied to operands of type 'string' and 'string' (CS0019) DDMMYYYY to DD-MM-YYYY Example: 20022022 to 20-02-2022 My code is: Code: string DD = numericUpDown1.Text; string MM = numericUpDown2.Text; string YYYY = numericUpDown3.Text; string BIOSDate = DD-MM-YYYY; System.Diagnostics.Process.Start("C:\\Windows\\system32\\cmd.exe", "/c date BIOSDate"); Thank you so much.
Unfortunately, it didn't. It's about command-line arguments of a program. I need to convert Int32 or String values to Date & Time.
@example12345678912345678 Change Code: string BIOSDate = DD-MM-YYYY; to Code: string BIOSDate = DD + "-" + MM + "- " + YYYY; for concatenation.
@example12345678912345678 You're taking the year in 4 digits, while the "date" parameter only accepts it in two digits (YY) format.
I think I forgot to say. It looks like I should not use strings inside brackets. But fixed this error when I use strings outside of brackets. Thanks for help anyways.