Notepad on-line
// ids is an IEnumerable of Stringvar integers = ids.Select(x => int.Parse(x));// to convert and sort at the same time:var sortedIds = ids.Select(x => int.Parse(x)).OrderBy(x => x));