i am extracting 4 strings from a text, then i want to create an object with attributes from them, using the first string as the object name and the rest as attributes :
public void Load()
{
string line = File.ReadAllText(path);
foreach (var item in line)
{
string objectname = line.Split(':', '#')[1];
string Name = line.Split('$', ':')[2];
string Number = line.Split(':', '%')[3];
string Addres = line.Split(':', '&')[4];
StringBuilder StringBuilder = new StringBuilder();
}
}
should i use StringBuilder for this? and how?
StringBuilderis for creating strings, so no. You need to look into serialization.