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

C#

 
GeneralRe: Get CPU Serial Number in WinRT Pin
Dave Kreskowiak9-Feb-12 2:03
mveDave Kreskowiak9-Feb-12 2:03 
GeneralRe: Get CPU Serial Number in WinRT Pin
Kevin Marois9-Feb-12 5:17
professionalKevin Marois9-Feb-12 5:17 
GeneralRe: Get CPU Serial Number in WinRT Pin
Dave Kreskowiak9-Feb-12 11:18
mveDave Kreskowiak9-Feb-12 11:18 
GeneralRe: Get CPU Serial Number in WinRT Pin
Kevin Marois9-Feb-12 12:18
professionalKevin Marois9-Feb-12 12:18 
GeneralRe: Get CPU Serial Number in WinRT Pin
Dave Kreskowiak9-Feb-12 16:38
mveDave Kreskowiak9-Feb-12 16:38 
QuestionWhy is my regex cutting of last char when doing replace? Pin
KimberlyKetchum8-Feb-12 11:24
KimberlyKetchum8-Feb-12 11:24 
AnswerRe: Why is my regex cutting of last char when doing replace? Pin
Peter_in_27808-Feb-12 12:02
professionalPeter_in_27808-Feb-12 12:02 
AnswerRe: Why is my regex cutting of last char when doing replace? Pin
Luc Pattyn8-Feb-12 12:07
sitebuilderLuc Pattyn8-Feb-12 12:07 
KimberlyKetchum wrote:
when the LF is replaced with CRLF that the last char in the line is cut off

That is more or less what you ordered, as "[^\r]\n" represents a single character that isn't \r, followed by \n, so assuming your input does not have any \r, then you are replacing each last char on a line by a \r.

A better approach would be a double replace:
- first replace \r\n by \n
- then replace \n by \r\n

The first step is a safety precaution in case the file already has \r\n somewhere.

BTW: why are you using a stream and its ReadToEnd method, that just doesn't make sense. Either you want a streaming operation (which would make much sense here), or you want all the text at once, and then File.ReadAllText() would be the obvious way.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

Fed up by FireFox memory leaks I switched to Opera and now CP doesn't perform its paste magic, so links will not be offered. Sorry.

AnswerRe: Why is my regex cutting of last char when doing replace? Pin
Bernhard Hiller8-Feb-12 20:51
Bernhard Hiller8-Feb-12 20:51 
QuestionAnybody familiar with compression? (Using it I mean) Pin
SledgeHammer018-Feb-12 8:21
SledgeHammer018-Feb-12 8:21 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn8-Feb-12 8:28
sitebuilderLuc Pattyn8-Feb-12 8:28 
GeneralRe: Anybody familiar with compression? (Using it I mean) Pin
SledgeHammer018-Feb-12 9:53
SledgeHammer018-Feb-12 9:53 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn8-Feb-12 10:04
sitebuilderLuc Pattyn8-Feb-12 10:04 
GeneralRe: Anybody familiar with compression? (Using it I mean) Pin
harold aptroot8-Feb-12 10:13
harold aptroot8-Feb-12 10:13 
GeneralRe: Anybody familiar with compression? (Using it I mean) Pin
SledgeHammer018-Feb-12 11:52
SledgeHammer018-Feb-12 11:52 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn8-Feb-12 12:12
sitebuilderLuc Pattyn8-Feb-12 12:12 
GeneralRe: Anybody familiar with compression? (Using it I mean) Pin
SledgeHammer018-Feb-12 13:08
SledgeHammer018-Feb-12 13:08 
GeneralRe: Anybody familiar with compression? (Using it I mean) Pin
SledgeHammer018-Feb-12 13:56
SledgeHammer018-Feb-12 13:56 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn9-Feb-12 4:33
sitebuilderLuc Pattyn9-Feb-12 4:33 
AnswerRe: Anybody familiar with compression? (Using it I mean) Pin
Luc Pattyn8-Feb-12 10:39
sitebuilderLuc Pattyn8-Feb-12 10:39 
QuestionUsing Controls in multiple threads Pin
Danzy838-Feb-12 7:47
Danzy838-Feb-12 7:47 
AnswerRe: Using Controls in multiple threads Pin
Luc Pattyn8-Feb-12 8:21
sitebuilderLuc Pattyn8-Feb-12 8:21 
AnswerRe: Using Controls in multiple threads Pin
DaveyM698-Feb-12 8:43
professionalDaveyM698-Feb-12 8:43 
QuestionThe type or namespace name 'Excel' could not be found Pin
pmcm8-Feb-12 5:17
pmcm8-Feb-12 5:17 
AnswerRe: The type or namespace name 'Excel' could not be found Pin
Wes Aday8-Feb-12 5:24
professionalWes Aday8-Feb-12 5:24 

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.