Use something like this:
string testStr = "123XYZ";
string leftStr = testStr.Substring(0, 2); // gives "12"
string midStr = testStr.Substring(2, 3); // gives "3XY"
string rightStr = testStr.Substring(testStr.Length - 4, 4);// gives "3XYZ"
Perhaps you could make some methods from this and put them in a class of your own, if you like.
Reputation Points: 2023
Solved Threads: 644
Senior Poster
Offline 3,736 posts
since Oct 2008