---
title: "IEnumerable<string> checkboxes get old date"  
description: "IEnumerable<string> checkboxes get old date"  
author: "Allen Scott"  
published: 2015-05-27  
updated: 2015-05-27  
canonical: https://www.mindstick.com/forum/23268/ienumerable-string-checkboxes-get-old-date  
category: ".net"  
tags: ["asp.net", "asp.net mvc", "listbox"]  
reading_time: 1 minute  

---

# IEnumerable<string> checkboxes get old date

my [code](https://yourviews.mindstick.com/view/85458/alan-turing-the-mastermind-behind-cracking-the-enigma-code-during-world-war-ii) is :

IEnumerable<[string](https://www.mindstick.com/articles/1527/string-split-in-c-sharp)> checkboxes

checkboxes contains [data](https://www.mindstick.com/articles/13050/salesforce-aiming-to-dominate-predictive-analytics-with-data-science) :

<"4,12/16/2014 00:00:00">

<"8,11/16/2014 00:00:00">

<"6,10/16/2014 00:00:00">

4,8,6 are FileId

i need to get the fileId of oldDate from checkboxes list

## Replies

### Reply by David Miller

var allIds = checkboxes.Select(x=>int.Parse(x.Split(new []{','})[0]));

if you want the oldest

int.Parse((checkboxes.OrderBy(x => DateTime.Parse(x.Split(new[] {','})[1])).First()).Split(new[] {','})[0]);

both cases will fail if checkboxes is empty. Please validate first and check the parsing of the date, you may have to pass a proper formatter


---

Original Source: https://www.mindstick.com/forum/23268/ienumerable-string-checkboxes-get-old-date

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
