functions to make student csv file

This commit is contained in:
2017-08-10 16:07:33 -05:00
parent ed48b943aa
commit 50a04dbef0
3 changed files with 36 additions and 1 deletions

View File

@ -1101,5 +1101,17 @@ namespace EduNetworkBuilder
MessageBox.Show(Translate("NB_NotImplimented"));
}
public static string CSVSafeString(string source)
{
string dest = source;
char[] chars = { '\t', '\r', '\n', '\"', ',' };
if (dest.IndexOfAny(chars) >= 0)
{
dest = '\"' + dest.Replace("\"", "\"\"") + '\"'; //quotes around outside, replace " with ""
}
return dest;
}
}
}