-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathEdu.cs
43 lines (42 loc) · 1.5 KB
/
Edu.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
using System.Collections.Generic;
using Console = Colorful.Console;
using System.Drawing;
using System.Linq;
namespace Linkedin_Scrapper
{
/// <summary>
/// saves an Education data
/// </summary>
public class Edu
{
public string schoolName;
public string date;
public string field;
public string xx;
public Edu(string schoolName = "??", string date = "??", string field = "??", string xx = "??")
{
this.schoolName = schoolName;
this.date = date;
this.field = field;
this.xx = xx;
}
public Edu(string[] _eduInfo)
{
var eduInfo = _eduInfo.ToList();
var fieldIndex = eduInfo.IndexOf("Field Of Study");
if (fieldIndex == -1)
fieldIndex = eduInfo.IndexOf("Degree Name");
var dateIndex = eduInfo.IndexOf("Dates attended or expected graduation");
this.field = fieldIndex != -1 ? eduInfo[fieldIndex + 1] : "??";
this.date = dateIndex != -1 ? eduInfo[dateIndex + 1] : "??";
this.schoolName = eduInfo[0];
}
public string PrintToConsole()
{
var ret = "\n │\t" + schoolName + "\n │\t" + field + "\n │\t" + date;
Console.WriteFormatted("\n │\t" + schoolName, Color.LightGoldenrodYellow);
Console.Write("\n │\t" + field + "\n │\t" + date + "\n │");
return ret;
}
}
}