c# - How to get number at the end of string? -
i want retrive number sequence @ end of string. e.g.
string contentdbindex = regex.match("ab56cd1234", @"\d+").value;
gives me result 56
want result 1234
. how should ?
you can use end anchor ($
) this:
string contentdbindex = regex.match("ab56cd1234", @"\d+$").value;
Comments
Post a Comment