Click here to Skip to main content
15,914,222 members
Home / Discussions / C#
   

C#

 
AnswerRe: reading from a file Pin
Stefan Troschuetz5-Nov-06 4:44
Stefan Troschuetz5-Nov-06 4:44 
Questiondll AccessViolation Pin
ilmarga5-Nov-06 3:51
ilmarga5-Nov-06 3:51 
AnswerRe: dll AccessViolation Pin
Rob Graham5-Nov-06 5:09
Rob Graham5-Nov-06 5:09 
Questionsend and recieve bytes Pin
HRiazi5-Nov-06 3:20
HRiazi5-Nov-06 3:20 
AnswerRe: send and recieve bytes Pin
mertkan656-Nov-06 4:34
mertkan656-Nov-06 4:34 
QuestionGenerics/Collections return a specific object Pin
I_thought5-Nov-06 3:04
I_thought5-Nov-06 3:04 
AnswerRe: Generics/Collections return a specific object Pin
I_thought5-Nov-06 6:15
I_thought5-Nov-06 6:15 
AnswerRe: Generics/Collections return a specific object Pin
Judah Gabriel Himango5-Nov-06 12:26
sponsorJudah Gabriel Himango5-Nov-06 12:26 
For future reference, you can use the generic List's Find method. For example, if you had a list of strings, and you wanted to find the first string starting with "hello", it'd look like this:

string startsWithHello = myStrings.Find(MyCriteriaFunction);
...
bool MyCriteriaFunction(string input)
{
   return input.StartsWith("hello");
}


Alternately, you can use anonymous methods to do this in a more concise manner:

string startsWithHello = myStrings.Find(delegate(string input) 
{ 
   return input.StartsWith("hello"); 
});


The next version of C# includes syntax for writing lambda expressions, which simplifies this further:

string startsWithHello = myStrings.Find(s => s.StartsWith("hello"));


Additionally, the next version of the .NET framework will include System.Query.dll, allowing for language integrated query syntax. C# 3 takes advantage of this, and will allow you to write something like this:

string startsWithHello = from s in myStrings where s.StartsWith("hello");


Tech, life, family, faith: Give me a visit.
I'm currently blogging about: God-as-Judge, God-as-Forgiver
The apostle Paul, modernly speaking: Epistles of Paul

Judah Himango


Questionplz help: how can i open mht file in windows based form with C# Pin
mohamed magdi ali4-Nov-06 21:47
mohamed magdi ali4-Nov-06 21:47 
Questioncontrol . cs-->.dll Pin
rzvme4-Nov-06 21:31
rzvme4-Nov-06 21:31 
AnswerRe: control . cs-->.dll Pin
Stefan Troschuetz4-Nov-06 22:19
Stefan Troschuetz4-Nov-06 22:19 
AnswerRe: control . cs-->.dll Pin
Amar Chaudhary5-Nov-06 23:35
Amar Chaudhary5-Nov-06 23:35 
QuestionPlease HELP :: webbrowser within background worker [modified] Pin
Nadia Monalisa4-Nov-06 20:50
Nadia Monalisa4-Nov-06 20:50 
AnswerRe: Please HELP :: webbrowser within background worker Pin
Stefan Troschuetz4-Nov-06 22:28
Stefan Troschuetz4-Nov-06 22:28 
AnswerRe: Please HELP :: webbrowser within background worker Pin
Bradml5-Nov-06 0:46
Bradml5-Nov-06 0:46 
AnswerRe: Please HELP :: webbrowser within background worker Pin
mertkan656-Nov-06 21:10
mertkan656-Nov-06 21:10 
QuestionHow can I replace all occurance of a string except when it's enclosed with a special tag? Pin
AngryC4-Nov-06 17:59
AngryC4-Nov-06 17:59 
AnswerRe: How can I replace all occurance of a string except when it's enclosed with a special tag? Pin
wajih.boukaram4-Nov-06 20:11
wajih.boukaram4-Nov-06 20:11 
AnswerRe: How can I replace all occurance of a string except when it's enclosed with a special tag? Pin
Nadia Monalisa4-Nov-06 21:10
Nadia Monalisa4-Nov-06 21:10 
QuestionHow to detect if process if executed Pin
raptor00-coolguy4-Nov-06 16:09
raptor00-coolguy4-Nov-06 16:09 
AnswerRe: How to detect if process if executed Pin
Nadia Monalisa4-Nov-06 20:57
Nadia Monalisa4-Nov-06 20:57 
GeneralRe: How to detect if process if executed Pin
raptor00-coolguy5-Nov-06 4:32
raptor00-coolguy5-Nov-06 4:32 
Questionlinking between the forms... Pin
arjunsasikumar4-Nov-06 10:34
arjunsasikumar4-Nov-06 10:34 
AnswerRe: linking between the forms... Pin
sj_h14-Nov-06 11:48
sj_h14-Nov-06 11:48 
Questionquestion about program's name in open-with dlg Pin
likefood4-Nov-06 10:21
likefood4-Nov-06 10:21 

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.