Parse a string in c# after reading first and last alphabet -
i want cut string in c# after reading first , last alphabet.
string name = "20150910000549659abcd000007348summary.pdf";
string result = "abcd000007348"; // string name = "1234 abcd000007348 summary.pdf";
after reading 1234 "a" comes , @ last "s" comes want "abcd000007348"
simply use regex:
string cutstring(string input) { match result = regex.match(input, @"[a-za-z]+[0-9]+"); return result.value; }
Comments
Post a Comment