Click here to Skip to main content
15,899,679 members
Home / Discussions / C#
   

C#

 
GeneralRe: Form Styles.. Pin
Dio2219-Sep-07 8:43
Dio2219-Sep-07 8:43 
QuestionMonthCalendar refresh problem Pin
DeepToot19-Sep-07 5:35
DeepToot19-Sep-07 5:35 
AnswerRe: MonthCalendar refresh problem Pin
DeepToot20-Sep-07 3:34
DeepToot20-Sep-07 3:34 
QuestionC# - Sharing assembly between projects? Pin
wbjohnson19-Sep-07 5:24
wbjohnson19-Sep-07 5:24 
AnswerRe: C# - Sharing assembly between projects? Pin
Patrick Etc.19-Sep-07 15:51
Patrick Etc.19-Sep-07 15:51 
GeneralRe: C# - Sharing assembly between projects? Pin
wbjohnson19-Sep-07 21:14
wbjohnson19-Sep-07 21:14 
GeneralRe: C# - Sharing assembly between projects? Pin
Patrick Etc.20-Sep-07 3:53
Patrick Etc.20-Sep-07 3:53 
QuestionSplitting strings while taking escaped characters into account Pin
martin_hughes19-Sep-07 5:16
martin_hughes19-Sep-07 5:16 
I'm attempting to split a file containing records into a number of substrings. The file spec allows for the normal delimiter (') to be escaped within a record by being prefixed with a question mark. Unless there is some trick to it, I guess this rules out using String.Split() so I wrote the following

static ArrayList DealWithEscapedCharacters(StreamReader inputStream, char segmentTerminator, char escapeCharacter)
        {
            ArrayList results = new ArrayList();

            string tempBuffer = "";
            char previousChar = ' ';
            char currentChar;

            while (!inputStream.EndOfStream)
            {

                currentChar = (char)inputStream.Read();
                
                if (currentChar == segmentTerminator && previousChar != escapeCharacter)
                {
                    tempBuffer += currentChar;
                    results.Add(tempBuffer);
                    tempBuffer = "";
                }
                else
                {
                    tempBuffer += currentChar;
                }

                previousChar = currentChar;
            }

            return results;

        }


This works, and is very quick even on my laptop. However, can anyone suggest a better/more flexible/even more performant approach?


Me: Can you see the "up" arrow?
User:Errr...ummm....no.
Me: Can you see an arrow that points upwards?
User: Oh yes, I see it now!

-Excerpt from a support call taken by me, 08/31/2007

AnswerRe: Splitting strings while taking escaped characters into account Pin
Larantz19-Sep-07 10:41
Larantz19-Sep-07 10:41 
QuestionInter process communication Pin
KrunalC19-Sep-07 4:42
KrunalC19-Sep-07 4:42 
AnswerRe: Inter process communication Pin
led mike19-Sep-07 5:09
led mike19-Sep-07 5:09 
GeneralRe: Inter process communication Pin
KrunalC19-Sep-07 5:12
KrunalC19-Sep-07 5:12 
GeneralRe: Inter process communication Pin
led mike19-Sep-07 5:51
led mike19-Sep-07 5:51 
QuestionError creatin window handle Pin
eoe19-Sep-07 4:09
eoe19-Sep-07 4:09 
AnswerRe: Error creatin window handle Pin
Judah Gabriel Himango19-Sep-07 4:37
sponsorJudah Gabriel Himango19-Sep-07 4:37 
GeneralRe: Error creatin window handle Pin
eoe19-Sep-07 19:20
eoe19-Sep-07 19:20 
AnswerRe: Error creatin window handle Pin
mav.northwind19-Sep-07 19:17
mav.northwind19-Sep-07 19:17 
GeneralRe: Error creatin window handle Pin
eoe19-Sep-07 21:24
eoe19-Sep-07 21:24 
GeneralRe: Error creatin window handle Pin
Judah Gabriel Himango20-Sep-07 4:26
sponsorJudah Gabriel Himango20-Sep-07 4:26 
QuestionFire a keyboard event.... Pin
Arish rivlin19-Sep-07 3:56
Arish rivlin19-Sep-07 3:56 
AnswerRe: Fire a keyboard event.... Pin
Judah Gabriel Himango19-Sep-07 4:35
sponsorJudah Gabriel Himango19-Sep-07 4:35 
GeneralRe: Fire a keyboard event.... Pin
Arish rivlin19-Sep-07 6:10
Arish rivlin19-Sep-07 6:10 
QuestionWhy does my Service with Custom UserNamePasswordValidator not run?? Pin
jogibear998819-Sep-07 3:20
jogibear998819-Sep-07 3:20 
AnswerChannelDispatcher error Pin
jogibear998819-Sep-07 8:45
jogibear998819-Sep-07 8:45 
QuestionHow to Dynamically populate Checkbox in Gridview asp.net 2.0 Pin
SJSaranya19-Sep-07 3:13
SJSaranya19-Sep-07 3:13 

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.