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

C#

 
GeneralRe: FTP Multiple Files With Progress Pin
Bernhard Hiller21-Sep-16 20:54
Bernhard Hiller21-Sep-16 20:54 
GeneralRe: FTP Multiple Files With Progress Pin
Kevin Marois22-Sep-16 6:07
professionalKevin Marois22-Sep-16 6:07 
AnswerRe: FTP Multiple Files With Progress Pin
Peter_in_278022-Sep-16 15:07
professionalPeter_in_278022-Sep-16 15:07 
SuggestionRe: FTP Multiple Files With Progress Pin
Richard Deeming21-Sep-16 2:51
mveRichard Deeming21-Sep-16 2:51 
GeneralRe: FTP Multiple Files With Progress Pin
Kevin Marois21-Sep-16 9:19
professionalKevin Marois21-Sep-16 9:19 
QuestionIndexOutOfRange Exception When Using Multi Dimensional Array Pin
MadDashCoder20-Sep-16 6:07
MadDashCoder20-Sep-16 6:07 
AnswerRe: IndexOutOfRange Exception When Using Multi Dimensional Array Pin
OriginalGriff20-Sep-16 6:18
mveOriginalGriff20-Sep-16 6:18 
GeneralRe: IndexOutOfRange Exception When Using Multi Dimensional Array Pin
MadDashCoder20-Sep-16 6:40
MadDashCoder20-Sep-16 6:40 
Thank you so much for replying. I have made some modifications to my code and now it's giving me IndexOutOfRange Exception.

Please see my modified code below.
C#
string testString = "{ID:AA, Make: ABC, Year:1995},{ID:BB, Make:BBC, Year:2000},{Name: PDA, Make: DHS, Year:2006}";
string[] outerArray = Regex.Split(testString, "},{");
string[,] innerArray = new string[2, outerArray.Length];
string idPattern = "^(ID)(.*?),";
string namePattern = "^(Class)(.*?),";

for (int i = 0; i < outerArray.Length; i++)
{
    outerArray[i] = outerArray[i].Replace("{", "").Replace("}", "");
    for (int y = 0; y < innerArray.Length; y++)
    {
        for (int x = 0; x < innerArray.Length; x++)
        {
            var matched_ID = Regex.Match(outerArray[i], idPattern);
            var matched_Name = Regex.Match(outerArray[i], namePattern);

            if (matched_ID.Success)
            {
                innerArray[x, y] = (matched_ID.Value).Replace(",", "");
            }
            else if (matched_Name.Success)
            {
                innerArray[x, y] = (matched_Name.Value).Replace(",", "");
            }

            if (outerArray[i].Length > 0 && !outerArray[i].Contains("ID:") && !outerArray[i].Contains("Name:"))
            {
                innerArray[x, y] = outerArray[i];
            }

            if(matched_ID.Success)
            {
                outerArray[i] = outerArray[i].Replace(matched_ID.Value, "");
            }
            else if (matched_Name.Success)
            {
                outerArray[i] = outerArray[i].Replace(matched_Name.Value, "");
            }
        }
    }
}

AnswerRe: IndexOutOfRange Exception When Using Multi Dimensional Array Pin
ZurdoDev20-Sep-16 7:40
professionalZurdoDev20-Sep-16 7:40 
GeneralRe: IndexOutOfRange Exception When Using Multi Dimensional Array Pin
OriginalGriff20-Sep-16 8:03
mveOriginalGriff20-Sep-16 8:03 
SuggestionRe: IndexOutOfRange Exception When Using Multi Dimensional Array Pin
Richard Deeming20-Sep-16 8:16
mveRichard Deeming20-Sep-16 8:16 
AnswerRe: IndexOutOfRange Exception When Using Multi Dimensional Array Pin
Gerry Schmitz20-Sep-16 9:15
mveGerry Schmitz20-Sep-16 9:15 
Questionforms and SSO login Pin
V.20-Sep-16 1:19
professionalV.20-Sep-16 1:19 
QuestionSSRS Loop Through Report Datasets and Modify at Runtime Pin
David_4119-Sep-16 9:20
David_4119-Sep-16 9:20 
AnswerRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
Gerry Schmitz19-Sep-16 10:58
mveGerry Schmitz19-Sep-16 10:58 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
David_4119-Sep-16 11:13
David_4119-Sep-16 11:13 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
Gerry Schmitz19-Sep-16 18:05
mveGerry Schmitz19-Sep-16 18:05 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
David_4120-Sep-16 5:19
David_4120-Sep-16 5:19 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
Gerry Schmitz20-Sep-16 5:31
mveGerry Schmitz20-Sep-16 5:31 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
David_4120-Sep-16 7:53
David_4120-Sep-16 7:53 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
Gerry Schmitz20-Sep-16 8:34
mveGerry Schmitz20-Sep-16 8:34 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
David_4120-Sep-16 8:39
David_4120-Sep-16 8:39 
GeneralRe: SSRS Loop Through Report Datasets and Modify at Runtime Pin
Gerry Schmitz20-Sep-16 9:43
mveGerry Schmitz20-Sep-16 9:43 
QuestionHow to show SSRS report in asp.net from report server Pin
Tridip Bhattacharjee18-Sep-16 21:52
professionalTridip Bhattacharjee18-Sep-16 21:52 
AnswerRe: How to show SSRS report in asp.net from report server Pin
Richard MacCutchan18-Sep-16 22:20
mveRichard MacCutchan18-Sep-16 22:20 

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.