functions to make student csv file
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user