datatable name : images under that i have one column called image
under(image column) i have values
image1-school
image2-college
image3-mba
Now i need to extract only school college mba values from that column
and bind these values in check bo开发者_JS百科x listhow to achive this one
thank you
// first I need to create a match to see if the input string is in the corrent form
Match match = Regex.Match("image1-school", @"^image\d-(.*)$", RegexOptions.IgnoreCase);
// the parenthesis in the Regular Expression meeans the content must be place in a group
// as groups are 1 based, the first group is group[1]
if (match.Success)
{
// this string will have the value of whatever was within the parenthesis
string theStringYouWant = Regex.Match("image1-school", @"^image\d-(.*)$", RegexOptions.IgnoreCase).Groups[1].Value;
}
精彩评论