Click here to Skip to main content
15,905,782 members
Home / Discussions / C#
   

C#

 
AnswerRe: project Pin
Zhat12-Mar-09 2:37
Zhat12-Mar-09 2:37 
QuestionHow to check if extensions follows up in a list? Pin
Matjaz-xyz11-Mar-09 23:31
Matjaz-xyz11-Mar-09 23:31 
QuestionRe: How to check if extensions follows up in a list? Pin
Goobashi11-Mar-09 23:34
Goobashi11-Mar-09 23:34 
AnswerRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz11-Mar-09 23:40
Matjaz-xyz11-Mar-09 23:40 
QuestionRe: How to check if extensions follows up in a list? Pin
Goobashi11-Mar-09 23:39
Goobashi11-Mar-09 23:39 
AnswerRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:11
professional dan!sh 12-Mar-09 0:11 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:20
Matjaz-xyz12-Mar-09 0:20 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:26
professional dan!sh 12-Mar-09 0:26 
AFAIK you just need to set up some loops wisely. Here is a bit of quick and dirty approach I could think of:

List <string> s = new List <string>();
       s.Add("jpg");
       s.Add("tif");
       s.Add("jpg");
       s.Add("tif");
       s.Add("jpg");
       s.Add("jpg");
       s.Add("tif");
       s.Add("tif");
       s.Add("jpg");
       s.Add("tif");

       bool breakFor = false;
       int togetherCount = 1;
       for (int i = 1;i < s.Count -1;i++) {

         if (s[i] == s[i - 1]) {
           togetherCount++;
           continue;
         }
         else {
           int count = 0;
           while (count < togetherCount) {
             if (!(s[i + 1] == s[i + count])) {
               if (togetherCount > 1) {
                 MessageBox.Show("error");
                 breakFor = true;
                 break;
               }
             }
             count++;
           }
           if (breakFor) {
             break;
           }
           else {
             i = i + togetherCount;
             togetherCount = 1;
           }
         }
       }</string></string>



It might not be correct but good to start off I guess.

Happy Holi[^]
जय हिंद

GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:36
Matjaz-xyz12-Mar-09 0:36 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 1:44
Matjaz-xyz12-Mar-09 1:44 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 2:21
professional dan!sh 12-Mar-09 2:21 
GeneralRe: How to check if extensions follows up in a list? Pin
Luc Pattyn12-Mar-09 3:33
sitebuilderLuc Pattyn12-Mar-09 3:33 
AnswerRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:14
professional Xmen Real 12-Mar-09 0:14 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:22
Matjaz-xyz12-Mar-09 0:22 
GeneralRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:27
professional Xmen Real 12-Mar-09 0:27 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:30
Matjaz-xyz12-Mar-09 0:30 
GeneralRe: How to check if extensions follows up in a list? Pin
dan!sh 12-Mar-09 0:33
professional dan!sh 12-Mar-09 0:33 
GeneralRe: How to check if extensions follows up in a list? Pin
Matjaz-xyz12-Mar-09 0:35
Matjaz-xyz12-Mar-09 0:35 
GeneralRe: How to check if extensions follows up in a list? Pin
Xmen Real 12-Mar-09 0:35
professional Xmen Real 12-Mar-09 0:35 
GeneralRe: How to check if extensions follows up in a list? Pin
Luc Pattyn12-Mar-09 3:44
sitebuilderLuc Pattyn12-Mar-09 3:44 
QuestionWIN directory to DOS directory question Pin
Goobashi11-Mar-09 23:22
Goobashi11-Mar-09 23:22 
AnswerRe: WIN directory to DOS directory question Pin
musefan11-Mar-09 23:44
musefan11-Mar-09 23:44 
GeneralRe: WIN directory to DOS directory question Pin
Goobashi11-Mar-09 23:56
Goobashi11-Mar-09 23:56 
AnswerRe: WIN directory to DOS directory question Pin
Matjaz-xyz12-Mar-09 1:00
Matjaz-xyz12-Mar-09 1:00 
AnswerRe: WIN directory to DOS directory question Pin
0x3c012-Mar-09 1:44
0x3c012-Mar-09 1:44 

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.