I have the below piece of code:
string date = dtxt.Substring(5, 2) + @"/" + dtxt.Substring(7, 2) + @"/" + dtxt.Substring(0, 4);
The text I'm trying to parse with it is yyyyMMdd. So from 20150309 I need 03/09/2015. I don't use dateTime format as both the input and output are strings.
The issue is I get ArgumentOutOfRangeException. string.Substring(X, Y) should get the substring from the X index for Y length, shouldn't it?