Click here to Skip to main content
15,884,177 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to fasten the datareader and insert process Pin
harold aptroot25-Jun-09 3:52
harold aptroot25-Jun-09 3:52 
AnswerRe: how to fasten the datareader and insert process Pin
Luc Pattyn25-Jun-09 4:08
sitebuilderLuc Pattyn25-Jun-09 4:08 
AnswerRe: how to fasten the datareader and insert process Pin
PIEBALDconsult25-Jun-09 4:47
mvePIEBALDconsult25-Jun-09 4:47 
Questionstring Pin
arkiboys25-Jun-09 3:02
arkiboys25-Jun-09 3:02 
AnswerRe: string Pin
Keith Barrow25-Jun-09 3:08
professionalKeith Barrow25-Jun-09 3:08 
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 
At the risk of starting a flamewar how is

public string RemoveLetters(string original)<br/>{<br/>    System.Text.StringBuilder sb = new System.Text.StringBuilder();<br/>    for(int i = 0; i < original.Length; i++)<br/>    {<br/>      if(!char.IsLetter(original, i))<br/>         sb.Append(original[i]);<br/>    }<br/>    return sb.ToString();<br/>}

Simpler than:
Regex.Replace("your String", "[A-Za-z]", "");


Despite the common belief that string builders are better, they are inefficient for most applications, it'd be much quicker cycling through an array of chars (a-z) (or their equivalient integer values & converting) and removing them in a loop.

The regex will allow other caracters he'll probably need to remove to be added with ease.
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 
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 

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.