I am working with C# code and having issue with substring. My text file as below
Gr= line.Substring(0,5);
SGR = line.Substring(7,3);
subscriber = line.Substring(13,11);
INDV = line.Substring(27,11);
P&C = line.Substring(41,4);
MKR = line.Substring(47,2);Zip_Code= line.Substring(52,10);Zip_City= line.Substring(64,21);
RPTF = line.Substring(87,2);
Getting error on Zip_City string. I am counting it has max of 21 char but it has 19 as in above file so not sure how to adjust it every varying length of string in this column. Length of each column is fixed as shown above and I am counting spaces between the column as well. I have code written that pick up only line.StartsWith("60000")
T.I.A