Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralRe: Regular Expressions [modified] Pin
Luc Pattyn10-Sep-10 7:31
sitebuilderLuc Pattyn10-Sep-10 7:31 
GeneralRe: Regular Expressions Pin
AspDotNetDev10-Sep-10 8:14
protectorAspDotNetDev10-Sep-10 8:14 
GeneralRe: Regular Expressions Pin
Bassam Abdul-Baki10-Sep-10 11:58
professionalBassam Abdul-Baki10-Sep-10 11:58 
GeneralRe: Regular Expressions Pin
Luc Pattyn10-Sep-10 17:02
sitebuilderLuc Pattyn10-Sep-10 17:02 
GeneralRe: Regular Expressions Pin
PIEBALDconsult11-Sep-10 15:59
mvePIEBALDconsult11-Sep-10 15:59 
GeneralRe: Regular Expressions Pin
Luc Pattyn11-Sep-10 16:11
sitebuilderLuc Pattyn11-Sep-10 16:11 
GeneralRe: Regular Expressions Pin
Bassam Abdul-Baki10-Sep-10 16:48
professionalBassam Abdul-Baki10-Sep-10 16:48 
GeneralRe: Regular Expressions Pin
Luc Pattyn10-Sep-10 4:20
sitebuilderLuc Pattyn10-Sep-10 4:20 
Either

foreach(string s in stringCollection) {
    int i2=s.IndexOf('2');
    int i4=s.IndexOf('4');
    if (i2>=0 && i2<i4) output("match: "+s);
}


or

foreach(string s in stringCollection) {
    int i24=s.IndexOfAny('2','4');
    if (i24>=0 && s[i24]=='2') output("match: "+s);
}


Note: this is assuming there is at most one number in each string.

Smile | :)
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.


GeneralRe: Regular Expressions Pin
Bassam Abdul-Baki10-Sep-10 4:30
professionalBassam Abdul-Baki10-Sep-10 4:30 
GeneralRe: Regular Expressions Pin
Luc Pattyn10-Sep-10 4:41
sitebuilderLuc Pattyn10-Sep-10 4:41 
GeneralRe: Regular Expressions Pin
Bassam Abdul-Baki10-Sep-10 4:50
professionalBassam Abdul-Baki10-Sep-10 4:50 
GeneralRe: Regular Expressions Pin
Luc Pattyn10-Sep-10 4:54
sitebuilderLuc Pattyn10-Sep-10 4:54 
GeneralRe: Regular Expressions Pin
Bassam Abdul-Baki10-Sep-10 5:02
professionalBassam Abdul-Baki10-Sep-10 5:02 
GeneralRe: Regular Expressions Pin
PIEBALDconsult10-Sep-10 14:52
mvePIEBALDconsult10-Sep-10 14:52 
GeneralRe: Regular Expressions [modified] Pin
PIEBALDconsult11-Sep-10 4:30
mvePIEBALDconsult11-Sep-10 4:30 
Questionis C# in .Net 3.5 slower than C# in .Net 1.1 Pin
RugbyLeague10-Sep-10 2:20
RugbyLeague10-Sep-10 2:20 
AnswerRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
Luc Pattyn10-Sep-10 3:03
sitebuilderLuc Pattyn10-Sep-10 3:03 
GeneralRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
RugbyLeague10-Sep-10 3:11
RugbyLeague10-Sep-10 3:11 
AnswerRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
Luc Pattyn10-Sep-10 3:17
sitebuilderLuc Pattyn10-Sep-10 3:17 
GeneralRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
RugbyLeague10-Sep-10 3:21
RugbyLeague10-Sep-10 3:21 
GeneralRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
RugbyLeague10-Sep-10 5:48
RugbyLeague10-Sep-10 5:48 
GeneralRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
Luc Pattyn10-Sep-10 5:53
sitebuilderLuc Pattyn10-Sep-10 5:53 
GeneralRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
RugbyLeague10-Sep-10 5:55
RugbyLeague10-Sep-10 5:55 
GeneralRe: is C# in .Net 3.5 slower than C# in .Net 1.1 Pin
Luc Pattyn10-Sep-10 6:02
sitebuilderLuc Pattyn10-Sep-10 6:02 
Questionchar[] to string conversion Pin
Chesnokov Yuriy10-Sep-10 1:57
professionalChesnokov Yuriy10-Sep-10 1:57 

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.