Am 05.08.2013 15:59, schrieb jicman: > > Greetings! > > I have this code, > > foreach (...) > { > > if (std.string.tolower(fext[0]) == "doc" || > std.string.tolower(fext[0]) == "docx" || > std.string.tolower(fext[0]) == "xls" || > std.string.tolower(fext[0]) == "xlsx" || > std.string.tolower(fext[0]) == "ppt" || > std.string.tolower(fext[0]) == "pptx") > continue; > } >
That's how I would do it. if(["doc", "docx", "xls", "xlsx", "ppt", "pptx"].canFind(fext[0].toLower) { continue; } With the array beeing a runtime/compiletime constant with a sensible name. WORD_EXTENSIONS or something.