public static void Main()
string test = "a b cdf 7654321";
string stringBefore = test.Substring(0, test.Length - 7);
string integer = test.Substring(test.Length - 7);
Console.WriteLine("Substring way: ");
Console.WriteLine("'{0}'", stringBefore);
Console.WriteLine("'{0}'", integer);
Console.WriteLine("LINQ Extension method way: ");
foreach(var s in test.SplitString(7))
Console.WriteLine("'{0}'", s);
public static class StringExtensions
public static string[] SplitString(this string input, int index)
if(index < 0 || input.Length < index)
throw new IndexOutOfRangeException();
String.Concat(input.Take(input.Length - index)),
String.Concat(input.Skip(input.Length - index))