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

C#

 
AnswerRepost Pin
Not Active2-Dec-11 9:44
mentorNot Active2-Dec-11 9:44 
AnswerRe: get type of anonymous list Pin
Wonde Tadesse2-Dec-11 16:48
professionalWonde Tadesse2-Dec-11 16:48 
QuestionIncluding an additional enum property into an object? Pin
Goalie352-Dec-11 9:20
Goalie352-Dec-11 9:20 
AnswerRe: Including an additional enum property into an object? Pin
Not Active2-Dec-11 9:47
mentorNot Active2-Dec-11 9:47 
AnswerRe: Including an additional enum property into an object? Pin
BillWoodruff2-Dec-11 19:27
professionalBillWoodruff2-Dec-11 19:27 
Questionstring concatenation: several seconds Pin
pirotrav2-Dec-11 2:35
pirotrav2-Dec-11 2:35 
AnswerRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 2:43
Rob Philpott2-Dec-11 2:43 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 2:48
pirotrav2-Dec-11 2:48 
string[] strOutput = alFormOutput.ToArray(typeof(string)) as string[];

Func<string, object=""> convert = str =>
{
try { return int.Parse(str); }
catch { return str; }
};
var sorted = strOutput.OrderBy(
str => Regex.Split(str.Replace(" ", ""), "([0-9]+)").Select(convert),
new sortAlg.EnumerableComparer<object>());

Part of this I borrowed from another document, but to my understanding sorted is an array of strings. Before I send it to the 'sort' (where all of the above code and previous code posted is located) function, it is an arrayList. Do note that the sorting itself takes probably only a second on several hundred items. I tested that with timers and it was not the issue. Wish I could answer better, but I only partially understand natural sort.

Here is the article the code above is based on.
http://www.interact-sw.co.uk/iangblog/2007/12/13/natural-sorting[^]

scroll to the bottom.

appreciate the quick reply
GeneralRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 2:51
Rob Philpott2-Dec-11 2:51 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 2:57
pirotrav2-Dec-11 2:57 
GeneralRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 3:13
Rob Philpott2-Dec-11 3:13 
GeneralRe: string concatenation: several seconds Pin
BobJanova2-Dec-11 5:49
BobJanova2-Dec-11 5:49 
GeneralRe: string concatenation: several seconds Pin
Rob Philpott2-Dec-11 5:55
Rob Philpott2-Dec-11 5:55 
GeneralRe: string concatenation: several seconds Pin
BobJanova2-Dec-11 6:05
BobJanova2-Dec-11 6:05 
GeneralRe: string concatenation: several seconds Pin
Not Active2-Dec-11 3:01
mentorNot Active2-Dec-11 3:01 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 3:13
pirotrav2-Dec-11 3:13 
GeneralRe: string concatenation: several seconds Pin
Not Active2-Dec-11 4:04
mentorNot Active2-Dec-11 4:04 
AnswerRe: string concatenation: several seconds Pin
emardini2-Dec-11 3:34
emardini2-Dec-11 3:34 
GeneralRe: string concatenation: several seconds Pin
pirotrav2-Dec-11 21:03
pirotrav2-Dec-11 21:03 
GeneralRe: string concatenation: several seconds Pin
Gerry Schmitz2-Dec-11 22:23
mveGerry Schmitz2-Dec-11 22:23 
GeneralRe: string concatenation: several seconds Pin
pirotrav3-Dec-11 19:26
pirotrav3-Dec-11 19:26 
AnswerRe: string concatenation: several seconds Pin
PIEBALDconsult2-Dec-11 3:48
mvePIEBALDconsult2-Dec-11 3:48 
AnswerRe: string concatenation: several seconds Pin
OriginalGriff2-Dec-11 4:14
mveOriginalGriff2-Dec-11 4:14 
QuestionRe: string concatenation: several seconds Pin
Luc Pattyn2-Dec-11 4:57
sitebuilderLuc Pattyn2-Dec-11 4:57 
AnswerRe: string concatenation: several seconds Pin
OriginalGriff2-Dec-11 5:56
mveOriginalGriff2-Dec-11 5:56 

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.