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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -