Click here to Skip to main content
15,887,083 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# workin with xsd file Pin
PIEBALDconsult30-Aug-12 18:52
mvePIEBALDconsult30-Aug-12 18:52 
AnswerRe: C# workin with xsd file Pin
RobCroll30-Aug-12 19:11
RobCroll30-Aug-12 19:11 
AnswerRe: C# workin with xsd file Pin
jschell31-Aug-12 7:13
jschell31-Aug-12 7:13 
QuestionCan I import forms into C# Pin
PapaGeek30-Aug-12 8:32
PapaGeek30-Aug-12 8:32 
AnswerRe: Can I import forms into C# Pin
OriginalGriff30-Aug-12 8:43
mveOriginalGriff30-Aug-12 8:43 
GeneralRe: Can I import forms into C# Pin
PapaGeek30-Aug-12 10:14
PapaGeek30-Aug-12 10:14 
GeneralRe: Can I import forms into C# Pin
OriginalGriff30-Aug-12 21:26
mveOriginalGriff30-Aug-12 21:26 
QuestionIs there a way to get a "\n\n" down to a single "\n"? Pin
glennPattonWork330-Aug-12 5:36
professionalglennPattonWork330-Aug-12 5:36 
Umm Hi,
This is a question related to yesterdays "Blank lines in a rich text box from a Serial Device, am I getting rid of them correctly....." I have found an oddity with the data I am reading in at odd times I get "\n" appearing (it's serial data) I am using a foreach() loop to split up the data coming in with one one the delimiters being "\n" I'm guessing that as there are two next to each other it see one kills it and lets the other pass,
Resulting in a blank line. If I use
C#
if (subString == "\n")
       break;
with out effect
I have got it so it creates the a save file as
Quote:
8/30/2012 3:51:21 PM| LD:0002=H10003027710004940129142|
8/30/2012 3:51:21 PM||
8/30/2012 3:51:21 PM| LD:0003=H2000749724900011250077140|

What I need to do is stop the above line appearing in the save function.
The foreach to assemble the string is
C#
foreach (string subString in Unit_Reply.Split(delimeter))
      {
          //if (subString == "")
          //    break;
          //if (subString == " ")
          //    break;
          //if (subString == "\r")
          //    break;
          if (subString == "\n")
              break;
          if (subString.Contains("\n")||subString.Contains("\r"))
          {
              MessageBox.Show("ALERT!!!");
          }
              Unit_Reply_Modded += "\n" + dt.ToString() + "|" + subString + "|";

               //MessageBox.Show(Unit_Reply_Modded);

      }

the commented out lines have been tried and found not to work (also the if Contains does nothing), I was trying to avoid using the StreamReader / Writer and BinaryReader /Writer as I am a little of how they work also I am attempting to read data from a board I read in the past with out using them.
AnswerRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
Manfred Rudolf Bihy30-Aug-12 6:24
professionalManfred Rudolf Bihy30-Aug-12 6:24 
GeneralRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
glennPattonWork330-Aug-12 23:07
professionalglennPattonWork330-Aug-12 23:07 
GeneralRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
Manfred Rudolf Bihy30-Aug-12 23:26
professionalManfred Rudolf Bihy30-Aug-12 23:26 
AnswerRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
PIEBALDconsult30-Aug-12 13:25
mvePIEBALDconsult30-Aug-12 13:25 
GeneralRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
Manfred Rudolf Bihy30-Aug-12 17:25
professionalManfred Rudolf Bihy30-Aug-12 17:25 
GeneralRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
glennPattonWork330-Aug-12 23:08
professionalglennPattonWork330-Aug-12 23:08 
GeneralRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
PIEBALDconsult31-Aug-12 4:12
mvePIEBALDconsult31-Aug-12 4:12 
GeneralRe: Is there a way to get a "\n\n" down to a single "\n"? Pin
glennPattonWork331-Aug-12 4:19
professionalglennPattonWork331-Aug-12 4:19 
Questionapp.config file Pin
dcof30-Aug-12 4:09
dcof30-Aug-12 4:09 
AnswerRe: app.config file Pin
jschell30-Aug-12 8:54
jschell30-Aug-12 8:54 
GeneralRe: app.config file Pin
Aby Thomas Varghese30-Aug-12 11:52
Aby Thomas Varghese30-Aug-12 11:52 
GeneralRe: app.config file Pin
dcof30-Aug-12 18:03
dcof30-Aug-12 18:03 
GeneralRe: app.config file Pin
Pete O'Hanlon30-Aug-12 22:17
mvePete O'Hanlon30-Aug-12 22:17 
GeneralRe: app.config file Pin
Pete O'Hanlon30-Aug-12 22:13
mvePete O'Hanlon30-Aug-12 22:13 
GeneralRe: app.config file Pin
jschell31-Aug-12 6:48
jschell31-Aug-12 6:48 
GeneralRe: app.config file Pin
Pete O'Hanlon31-Aug-12 8:56
mvePete O'Hanlon31-Aug-12 8:56 
GeneralRe: app.config file Pin
jschell1-Sep-12 11:08
jschell1-Sep-12 11:08 

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.