Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
AnswerRe: string Pin
himanshu256125-Jun-09 3:13
himanshu256125-Jun-09 3:13 
AnswerRe: string [modified] PinPopular
musefan25-Jun-09 3:22
musefan25-Jun-09 3:22 
GeneralRe: string Pin
Keith Barrow25-Jun-09 3:37
professionalKeith Barrow25-Jun-09 3:37 
GeneralRe: string Pin
musefan25-Jun-09 4:07
musefan25-Jun-09 4:07 
GeneralRe: string Pin
EliottA25-Jun-09 4:08
EliottA25-Jun-09 4:08 
JokeRe: string Pin
J4amieC25-Jun-09 5:11
J4amieC25-Jun-09 5:11 
GeneralRe: string Pin
EliottA25-Jun-09 10:21
EliottA25-Jun-09 10:21 
GeneralRe: string Pin
Luc Pattyn25-Jun-09 12:31
sitebuilderLuc Pattyn25-Jun-09 12:31 
Hi,

the regex approach is easy to write, however it is not very CPU-efficient; in my test it was between 8 and 9 times slower than the StringBuilder plus for-loop approach. And StringBuilder *is* the right approach when one has to perform a reasonable number of concatenations, since, without them, each operation would have to create a new string and copy its content (a quadratic cost).

When more complex character collections have to be removed, isAlpha is not useful anymore, IndexOf could be the right approach; it would slow down the for-loop by a factor of 2, however the regex also slows down when adding to the search set.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.

GeneralRe: string Pin
J4amieC25-Jun-09 4:45
J4amieC25-Jun-09 4:45 
GeneralRe: string Pin
musefan25-Jun-09 4:59
musefan25-Jun-09 4:59 
QuestionRouter's bytes transferred so far Pin
Muammar©25-Jun-09 2:58
Muammar©25-Jun-09 2:58 
GeneralRe: Router's bytes transferred so far Pin
harold aptroot25-Jun-09 3:02
harold aptroot25-Jun-09 3:02 
AnswerRe: Router's bytes transferred so far Pin
Rajesh R Subramanian25-Jun-09 3:04
professionalRajesh R Subramanian25-Jun-09 3:04 
AnswerRe: Router's bytes transferred so far Pin
OriginalGriff25-Jun-09 3:06
mveOriginalGriff25-Jun-09 3:06 
Questionopening child window in mdi application. Pin
vinay_K25-Jun-09 2:44
vinay_K25-Jun-09 2:44 
Questiongui problem Pin
Serv-dee25-Jun-09 2:07
Serv-dee25-Jun-09 2:07 
QuestionRe: gui problem Pin
harold aptroot25-Jun-09 2:13
harold aptroot25-Jun-09 2:13 
AnswerRe: gui problem Pin
Rajesh R Subramanian25-Jun-09 2:43
professionalRajesh R Subramanian25-Jun-09 2:43 
AnswerRe: gui problem [modified] Pin
padmanabhan N25-Jun-09 2:14
padmanabhan N25-Jun-09 2:14 
GeneralRe: gui problem Pin
J4amieC25-Jun-09 2:27
J4amieC25-Jun-09 2:27 
AnswerRe: gui problem Pin
Pete O'Hanlon25-Jun-09 2:47
mvePete O'Hanlon25-Jun-09 2:47 
GeneralRe: gui problem Pin
Rajesh R Subramanian25-Jun-09 2:52
professionalRajesh R Subramanian25-Jun-09 2:52 
GeneralRe: gui problem Pin
Pete O'Hanlon25-Jun-09 3:03
mvePete O'Hanlon25-Jun-09 3:03 
GeneralRe: gui problem Pin
Rajesh R Subramanian25-Jun-09 3:09
professionalRajesh R Subramanian25-Jun-09 3:09 
QuestionDate Format Pin
kibromg25-Jun-09 1:43
kibromg25-Jun-09 1:43 

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.