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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -