Click here to Skip to main content
15,888,461 members
Home / Discussions / C#
   

C#

 
GeneralRe: How can I clear a file's content? Pin
kidult22-Jan-15 21:06
kidult22-Jan-15 21:06 
GeneralRe: How can I clear a file's content? Pin
Wendelius23-Jan-15 2:42
mentorWendelius23-Jan-15 2:42 
Questionc# validation Pin
Member 1135438622-Jan-15 13:51
Member 1135438622-Jan-15 13:51 
GeneralRe: c# validation Pin
PIEBALDconsult22-Jan-15 14:33
mvePIEBALDconsult22-Jan-15 14:33 
GeneralRe: c# validation Pin
Member 1135438622-Jan-15 17:17
Member 1135438622-Jan-15 17:17 
AnswerRe: c# validation Pin
Mycroft Holmes22-Jan-15 15:51
professionalMycroft Holmes22-Jan-15 15:51 
GeneralRe: c# validation Pin
Member 1135438622-Jan-15 17:15
Member 1135438622-Jan-15 17:15 
GeneralRe: c# validation Pin
PIEBALDconsult22-Jan-15 18:42
mvePIEBALDconsult22-Jan-15 18:42 
Member 11354386 wrote:
must be monday tuesday wednedsay thursday or friday


I would probably just use a Hashset with a case-insensitive comparer, add the valid values, and then test for Contains.
Another option would be to use an enumeration and try Parsing the value.



See also: Dictionary<string,T>.BestMatch[^]

And remember that your teacher will likely know what you are capable of and will know if you turn in code you didn't write yourself, so take any ideas you may encounter and write your own solution.
GeneralRe: c# validation Pin
Member 108362351-Feb-15 20:05
Member 108362351-Feb-15 20:05 
QuestionGiving a property a value when it lacks set-method? Pin
Member 1139440322-Jan-15 2:09
Member 1139440322-Jan-15 2:09 
AnswerRe: Giving a property a value when it lacks set-method? Pin
OriginalGriff22-Jan-15 2:51
mveOriginalGriff22-Jan-15 2:51 
GeneralRe: Giving a property a value when it lacks set-method? Pin
Member 1139440322-Jan-15 3:55
Member 1139440322-Jan-15 3:55 
GeneralRe: Giving a property a value when it lacks set-method? Pin
Richard Deeming22-Jan-15 4:25
mveRichard Deeming22-Jan-15 4:25 
GeneralRe: Giving a property a value when it lacks set-method? Pin
Member 1139440324-Jan-15 3:29
Member 1139440324-Jan-15 3:29 
GeneralRe: Giving a property a value when it lacks set-method? Pin
BillWoodruff22-Jan-15 5:11
professionalBillWoodruff22-Jan-15 5:11 
Questioni want code for read data from hyperterminal Pin
Member 1135275122-Jan-15 1:09
Member 1135275122-Jan-15 1:09 
AnswerRe: i want code for read data from hyperterminal Pin
Manfred Rudolf Bihy22-Jan-15 1:33
professionalManfred Rudolf Bihy22-Jan-15 1:33 
AnswerRe: i want code for read data from hyperterminal Pin
OriginalGriff22-Jan-15 2:53
mveOriginalGriff22-Jan-15 2:53 
QuestionDefragmentor in c# Pin
Anoop Mishra21-Jan-15 23:42
Anoop Mishra21-Jan-15 23:42 
AnswerRe: Defragmentor in c# Pin
harold aptroot21-Jan-15 23:46
harold aptroot21-Jan-15 23:46 
QuestionAuto Update Sql Database Schema Pin
Zeyad Jalil21-Jan-15 20:32
professionalZeyad Jalil21-Jan-15 20:32 
AnswerRe: Auto Update Sql Database Schema Pin
Mycroft Holmes21-Jan-15 20:42
professionalMycroft Holmes21-Jan-15 20:42 
AnswerRe: Auto Update Sql Database Schema Pin
OriginalGriff21-Jan-15 22:07
mveOriginalGriff21-Jan-15 22:07 
QuestionAsp.net Mvc web api Pin
Member 1139320421-Jan-15 19:19
Member 1139320421-Jan-15 19:19 
AnswerRe: Asp.net Mvc web api Pin
Richard MacCutchan21-Jan-15 21:10
mveRichard MacCutchan21-Jan-15 21:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.