I want to know how to split the string into different lengths or chunks. E.g. I want the name to be split into 0 to 19 with 0 the starting position and 19 the ending position. Any ideas on how I could do this?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace employeefinal
{
class Program
{
static void Main(string[] args)
{
employee i = new employee("Tom");
Console.WriteLine(i.getString());
Console.ReadLine();
}
public class employee
{
string employeename = "Name: John Smith, L, U, 012, 2, 7, 2, 4";
public employee(string name)
{
this.employeename = name;
}
public string getString()
{
employeename.Substring(0, 19).Trim();
return employeename;
}
}
}
}
Urepresent in that string..?