zimmer9
asked on
How to read the rightmost 8 positions into a string using a C# console application?
I am developing a C# Console application using Visual Studio 2005.
My code follows in the code section.
How could I change the code and replace the following statement:
String formattedString = itemsequence.Substring(7, 8);
with another statement that assigns the rightmost 8 positions to formattedString, since I am checking for a field length of at least 8 positions and I want to assign just the right most positions.
My code follows in the code section.
How could I change the code and replace the following statement:
String formattedString = itemsequence.Substring(7, 8);
with another statement that assigns the rightmost 8 positions to formattedString, since I am checking for a field length of at least 8 positions and I want to assign just the right most positions.
if (reader.Name.Length >= 8)
{
arr1[i, 11] = "GROUP_FIELD_NAME:CpcsNo";
itemsequence = reader.ReadElementContentAsString();
String formattedString = itemsequence.Substring(7, 8);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.