Skip to content

Commit

Permalink
Merge pull request #111 from kzi-nastava/fix/Tutor-toCSV
Browse files Browse the repository at this point in the history
[Fix] ToCSV method to avoid adding an additional separator when there…
  • Loading branch information
anasinik authored Apr 1, 2024
2 parents 9062953 + 9b8f5e8 commit fa3bc1c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions LangLang/Core/Model/Tutor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,19 @@ public void FromCSV(string[] values)

public string[] ToCSV()
{
string[] csvValues =
{
_profile.ToString(),
_employmentDate.ToString("yyyy-MM-dd"),
DictToCSV(_languageSkills)
};

return csvValues;
if (_languageSkills.Count > 0)
{
return new string[] {
_profile.ToString(),
_employmentDate.ToString("yyyy-MM-dd"),
DictToCSV(_languageSkills) };
}
else
{
return new string[] {
_profile.ToString(),
_employmentDate.ToString("yyyy-MM-dd") };
}
}

public string DictToCSV(Dictionary<string, LanguageLevel> skills)
Expand Down

0 comments on commit fa3bc1c

Please sign in to comment.