O
O
onlinejunior2020-04-30 15:06:12
C++ / C#
onlinejunior, 2020-04-30 15:06:12

How else to pull out the value c #?

At the moment I'm pulling it like this:

string str = "https://www.site.com/bed/v4/6790244565673643270";

string str = "https://www.site.com/@bed/mp4/6790244565673643270";

var result = str.Split('/')[5];  //->6790244565673643270


How can I get it with regexp ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
twobomb, 2020-04-30
@onlinejunior

var result = Regex.Match(str, @"/(\d+)$").Groups[1];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question